fork download
  1. #include <functional>
  2. #include <iostream>
  3.  
  4. int main()
  5. {
  6. std::function<int (int)> hello = [&](int i)->int {
  7. if (--i != 0) hello(i);
  8. std::cout << "Hello, World!" << std::endl;
  9. return 0;
  10. };
  11.  
  12. return hello(10);
  13. }
  14.  
Success #stdin #stdout 0s 3060KB
stdin
Standard input is empty
stdout
Hello, World!
Hello, World!
Hello, World!
Hello, World!
Hello, World!
Hello, World!
Hello, World!
Hello, World!
Hello, World!
Hello, World!