I don't know what kind of error your got, try this:
class Thread {
public:
Thread() : thread_(new boost::thread(boost::bind(&Thread::run, this))) {
}
void run() {
}
~Thread() {
thread_->join();
}
private:
boost::scoped_ptr<boost::thread> thread_;
};
int main() {
Thread thread;
}
But do not forget, that thread may start before constructor end his job.