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

Markus Blatt markus at dr-blatt.de
Fri Jul 10 16:37:54 CEST 2015


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20150710/91c4ba66/attachment.sig>


More information about the Dune-devel mailing list