auto p = make_shared<string>();
p->swap( veryLongString );
And now you have a shared pointer with moved contents of veryLongString ;-)
Regards,
Kris
2012/10/4 Szymon Gatner
2012/10/4 Adi Shavit
: Hi,
How can I [boost::]move() veryLongString into the boost::thread ctor (probably using via boost::bind)? Is this possible?
Hi, Adi
sorry, bind() can only do as much also - either doing a copy of a std::string or using a reference to it.
As you mentioned, you have to use shared_ptr<> to pass ownership or use boost::container::string which is movable (even in 03 compilers via boost.move emulation) instead of std::string.
Cheers, Szymon _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users