fork download
  1. #include <iostream>
  2. #include <future>
  3. using namespace std;
  4.  
  5. struct theClass {
  6.  
  7. void member() {
  8. std::cout << "this out: " << (void*)this << std::endl;
  9. std::async([this]() {
  10. std::cout << "this in: " << (void*)this << std::endl;
  11. });
  12. }
  13.  
  14. };
  15.  
  16. int main() {
  17. theClass().member();
  18. return 0;
  19. }
Success #stdin #stdout 0s 18120KB
stdin
Standard input is empty
stdout
this out: 0x7fffd436681f
this in: 0x7fffd436681f