fork download
  1. #include <iostream>
  2.  
  3. struct Foo
  4. {
  5. Foo() { std::cout << "Foo()" << std::endl; }
  6. };
  7.  
  8. void foo()
  9. {
  10. static Foo f;
  11. }
  12.  
  13. int main()
  14. {
  15. std::cout << "start" << std::endl;
  16. foo();
  17. std::cout << "stop" << std::endl;
  18. }
  19.  
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
start
Foo()
stop