fork(1) download
  1. #include<thread>
  2. #include<iostream>
  3.  
  4. using std::cout;
  5. void foo(int a){
  6. cout<<a;
  7. }
  8.  
  9. template <typename T>
  10. void goo(void (*fn)(T),T c){
  11. fn(c);
  12. }
  13.  
  14. int main(void)
  15. {
  16. std::thread TH;
  17. void (*ptr)(int)=foo;
  18. TH= std::thread(&goo<int>,ptr,1);
  19. TH.join();
  20.  
  21. return 0;
  22. }
  23.  
Runtime error #stdin #stdout 0s 2960KB
stdin
Standard input is empty
stdout
Standard output is empty