1#include <iostream>
2#include <thread>
3
4class foo
5{
6public:
7 void make_foo_func_thread()
8 {
9 t=std::thread(&foo::foo_func, this);
10 t.join();
11 }
12
13private:
14 std::thread t;
15 void foo_func() { std::cout << "Hello\n"; }
16};
17
18int main()
19{
20 foo f;
21 f.make_foo_func_thread();
22}
23