fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int i = 0;
  5. static int j = 0;
  6.  
  7. struct Foo {
  8. void not_thread_safe() const { ++i; }
  9. void not_thread_safe2() const { ++j; }
  10. void not_thread_safe3() const { static int i = 0; ++i; }
  11. };
  12.  
  13. int main() {
  14. const Foo f;
  15. f.not_thread_safe();
  16. f.not_thread_safe2();
  17. f.not_thread_safe3();
  18. return 0;
  19. }
Success #stdin #stdout 0s 3408KB
stdin
Standard input is empty
stdout
Standard output is empty