fork download
  1. #include <iostream>
  2. #include <thread>
  3. using namespace std;
  4. struct Test
  5. {
  6. void run()
  7. {
  8.  
  9. }
  10.  
  11. };
  12.  
  13. void foo() {
  14. std::shared_ptr<Test> test = std::make_shared<Test>();
  15. std::thread th(&Test::run, test); // Compiler error
  16.  
  17. th.join();
  18.  
  19. }
  20. int main()
  21. {
  22.  
  23. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
Standard output is empty