[Dune-devel] [Dune-Commit] [Commit] dune-common - 13edbd2: [array][fs1691] Modernize array.hh.

Agnese, Marco m.agnese13 at imperial.ac.uk
Fri Jul 10 16:45:14 CEST 2015


Yes, I think so. 
To be honest I didn't think about it because I only modified the make_array but I think that it should be removed.

Cheers,
Marco
________________________________________
From: dune-devel-bounces+m.agnese13=imperial.ac.uk at dune-project.org [dune-devel-bounces+m.agnese13=imperial.ac.uk at dune-project.org] on behalf of Markus Blatt [markus at dr-blatt.de]
Sent: Friday, July 10, 2015 3:37 PM
To: dune-devel at dune-project.org
Subject: Re: [Dune-devel] [Dune-Commit] [Commit] dune-common - 13edbd2: [array][fs1691] Modernize array.hh.

On Fri, Jul 10, 2015 at 04:24:35PM +0200, Jö Fahlke wrote:
> New commit, appeared at Fri Jul 10 16:24:35 2015 +0200
> as part of the following ref changes:
>
>     branch refs/heads/master    updated from 2b2d7f9 -> 13edbd2
>
> Browsable version: http://cgit.dune-project.org/repositories/dune-common/commit/?id=13edbd2eb570a3d8a5914dd1dc513798bb0203e7
>
> ======================================================================
>
> commit 13edbd2eb570a3d8a5914dd1dc513798bb0203e7
> Author:     Marco Agnese <marco.agnese88 at gmail.com>
> AuthorDate: Thu Jul 9 13:27:43 2015 +0100
> Commit:     Jö Fahlke <jorrit at jorrit.de>
> CommitDate: Fri Jul 10 15:53:06 2015 +0200
>
>     [array][fs1691] Modernize array.hh.
>
>     Use std::array instead of Dune::array.
>     [make_array] use variadic template instead of different specialization
>
>  dune/common/array.hh | 87 +++++-----------------------------------------------
> @@ -125,9 +54,9 @@ namespace Dune
>     * \note This method is Dune-specific and not part of any C++ standard.
>     */
>    template<typename T, std::size_t n>
> -  array<T,n> fill_array(const T& t)
> +  std::array<T,n> fill_array(const T& t)
>    {
> -    array<T,n> r;
> +    std::array<T,n> r;
>      r.fill(t);
>      return std::move(r);

Shouldn't std::move be avoided here? To the very least it is
unnecessary. But I would assume that moving a std::array is at least
as expensive as relying on copy
elision. http://stackoverflow.com/questions/14856344/when-should-stdmove-be-used-on-a-function-return-value

Cheers,

Markus

--
Do you need more support with DUNE or HPC in general?

Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858




More information about the Dune-devel mailing list