|
Boost : |
Subject: Re: [boost] [move] moving temporaries of copyable types
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2009-08-10 11:07:10
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 10 August 2009, Ion Gaztañaga wrote:
> David Abrahams escribió:
> >
> > In both cases the temporary should get RVO'd (i.e. the copy should be
> > elided) on all modern compilers. If you can find a modern compiler
> > where Boost.Move does not RVO, then its design needs to be fixed.
Does Boost.Move support moveable-but-not-copyable types? Could this cause
compile errors for such types when compiling with optimization turned off?
> Yes in case of constructors but not with assigments:
>
> clone_ptr<MyClass> p;
>
> for(){
> p = return_rvalue();
> }
>
> Although I guess that this missed optimization might not be so
> important. The same could be applied to containers
>
> //With old approach, copied instead
> vector.push_back(return_rvalue());
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkqAN58ACgkQ5vihyNWuA4Vv+ACgzMVs/IUV9dkC5UZYfkGF5Fa9
AwkAoKxCExgH7lvJULK/iRr6TfArQ3Cs
=xP5S
-----END PGP SIGNATURE-----
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk