Skip to content
Snippets Groups Projects
Commit 18f5880f authored by Jö Fahlke's avatar Jö Fahlke
Browse files

[fill_array] Don't use std::move() when returning a locally created array.

That inhibits RVO and actually makes the code slower.  And even if the
compiler decides against RVO, the standard requires that he moves from the
object, if possible.  See Scott Meyers "Effective Modern C++", second half of
Item 25.

Thanks Markus Blatt for noticing.
parent 13edbd2e
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,7 @@ namespace Dune
{
std::array<T,n> r;
r.fill(t);
return std::move(r);
return r;
}
/** @} */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment