Hello folks,
The following scoped_thread that I wrote runs well with boost 1.42.0:
#include <boost/thread/thread.hpp>
#include <iostream>
class scoped_thread {
boost::thread t;
scoped_thread(const scoped_thread&);
scoped_thread operator=(const scoped_thread&);
public:
scoped_thread(boost::thread t_) : t(boost::move(t_) ) {
if (!t.joinable() )
throw;
}
~scoped_thread () {
t.join();
}
};
However, as you may notice I did not include <move.hpp> and did use boost::move in the ctor. Is the true std::move semantics already available on boost 1.42.0 by just including <boost/thread/thread.hpp>? If so (as my code illustrates), that would be nice.
Cheers,
Robert