4 Oct
2012
4 Oct
'12
9:11 a.m.
Hi, I'm using boost 1.51 on multiple platforms and compilers without C++11. In my main thread, I have a very long, expensive to copy, std::string veryLongString, that I need to pass to a new thread for processing. After the new thread is created I have no more use for veryLongString, hence I'd like to *move *it into the boost::thread ctor. Obviously, if veryLongString was created as a shared_ptrstd::string then I could just *copy* the shared_ptr into the thread ctor, but it wasn't, so I'd need to copy it anyway. How can I [boost::]move() veryLongString into the boost::thread ctor (probably using via boost::bind)? Is this possible? Thanks, Adi