fork download
  1. #include <iostream>
  2. #include <functional>
  3. using namespace std;
  4.  
  5. void TestFunction() {
  6. cout << "hello" << endl;
  7. }
  8.  
  9. int main() {
  10. function<void()> varFunction(TestFunction);
  11. varFunction();
  12. varFunction();
  13. return 0;
  14. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
hello
hello