Boost logo

Boost :

Subject: Re: [boost] [move] problem with msvc-10 (BOOST_MOVABLE_BUT_NOT_COPYABLE)
From: Oliver Kowalke (k-oli_at_[hidden])
Date: 2010-11-25 02:01:05


> Shouldn't this function use boost::move?
>
> X X::create()
> {
> boost::shared_ptr< impl_t > impl( new impl_t() );
> return boost::move( X( impl) );
> }

should work without move

> Shouldn't this declaration use boost::move?
>
> X x( boost::move(X::create()) );
>
> Or shouldn't X::create returns a rvalue to X?

should work without move - returns an rvalue

BOOST_MOVABLE_BUT_NOT_COPYABLE provides operators returning rv< X >.

g++-4.4.5 accepts code above and afaik msvc-9.0 (on32bit windows) too.

Oliver

-- 
GMX DSL Doppel-Flat ab 19,99 &euro;/mtl.! Jetzt auch mit 
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk