Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 21st, 2012  |  syntax: None  |  size: 0.40 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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);