[Libreoffice-commits] use init lists for property sequences

Bjoern Michaelsen bjoern.michaelsen at canonical.com
Tue Feb 24 03:32:03 PST 2015


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


More information about the LibreOffice mailing list