Le 13/08/13 16:09, Adam Romanek a écrit :
Hi,
I'd like to return a container of non-movables from a function in C++03 with no success.
Boost.Container should be movable independently on whether their elements are movable or not.
here is a sample code that does not compile for me:
#include
#include class non_copyable { BOOST_MOVABLE_BUT_NOT_COPYABLE(non_copyable)
public: non_copyable(){} non_copyable(BOOST_RV_REF(non_copyable)) {} non_copyable& operator=(BOOST_RV_REF(non_copyable)) { return *this; } };
typedef boost::container::vector
nc_vector; nc_vector create() { return nc_vector(); }
I suspect that this is a limitation on the emulation with gcc-4.6.3. Could you try nc_vector create() { nc_vector res; return boost::move(res); } Best, Vicente