Guest User

Untitled

a guest
Jun 21st, 2012
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. How to pass an argument to boost::thread?
  2. thread_ = boost::thread( boost::function< void (void)>( boost::bind( &clientTCP::run , this ) ) );
  3.  
  4. void clientTCP::run(boost:function<void(std::string)> func);
  5.  
  6. // Pass pMyParameter through to the run() function
  7. boost::bind(&clientTCP::run, this, pMyParameter)
  8.  
  9. void find_the_question(int the_answer);
  10.  
  11. boost::thread deep_thought_2(find_the_question,42);
Advertisement
Add Comment
Please, Sign In to add comment