fork download
  1. #include <iostream>
  2. #include <thread>
  3. #include <string>
  4.  
  5. namespace thread_test{
  6.  
  7. class create_index {
  8. public:
  9. void reference_index_hash(uint64_t &sequence_length, int &split, std::string &sequence_content, uint64_t &erase_length ) {
  10. std::cout << "thread running" << std::endl;
  11. }
  12. };
  13. }
  14.  
  15. int main() {
  16. thread_test::create_index index;
  17.  
  18. uint64_t sequence_length = 10;
  19. int split = 5;
  20. uint64_t erase_length = 0;
  21. std::string contents;
  22.  
  23. std::thread t(&thread_test::create_index::reference_index_hash, std::ref(index), std::ref(sequence_length), std::ref(split), std::ref(contents), std::ref(erase_length));
  24. t.join();
  25. return 0;
  26. }
Success #stdin #stdout 0s 4520KB
stdin
Standard input is empty
stdout
thread running