helloworld3.cpp 479 B

1234567891011121314151617181920
  1. // Copyright (C) 2001-2003
  2. // William E. Kempf
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. #include <boost/thread/thread.hpp>
  7. #include <boost/bind.hpp>
  8. #include <iostream>
  9. void helloworld(const char* who)
  10. {
  11. std::cout << who << "says, \"Hello World.\"" << std::endl;
  12. }
  13. int main()
  14. {
  15. boost::thread thrd(boost::bind(&helloworld, "Bob"));
  16. thrd.join();
  17. }