Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


Hi,

On Tue, Feb 24, 2015 at 08:13:56AM +0100, Stephan Bergmann wrote:
Rather than allowing to move out of the temporary pair, better avoid
its creation in the first place:

           for(auto const & aEntry : vInit)

Eh, true. But actually, I wanted both: Iterating over the pairs in the
initializer list by reference and still using the move-ctor from there. 

That use of std::move is actually a pessimization, as it prevents RVO.

How so? The RVO would be to do the ::std::move(). So this is just making that
(needlessly) explicit, isnt it? At least that is what I read from

 http://stackoverflow.com/questions/17473753/c11-return-value-optimization-or-move

Best,

Bjoern

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.