I want to make another thread in my application, so I'm doing it that way:
typedef boost::shared_ptr<boost::thread> wild_thread; void thread_routine(wild_thread t) { // do stuff } int main() { { wild_thread t; t.reset(new boost::thread(boost::bind(&thread_routine, t))); } // do other stuff } But this is ugly, I need to name this temporary shared_ptr.
So, the question is, can I do this with boost::make_shared anyhow? Can I somehow ask it to bind newly created shared_ptr into my thread_routine? Or maybe there is a better way?
tbefore it is initialized?wild_thread t; t.reset(new boost::thread(boost::bind(&thread_routine, t))).