boost::thread create_thread() { void some_function(); boost::thread t(some_function); return boost::move(t); } boost::thread threads[45]; threads[12]=boost::move(create_thread());