fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. #include <iostream>
  5.  
  6. class God
  7. {
  8. private:
  9. static God* firstObject;
  10. God()
  11. {
  12. if (firstObject != NULL)
  13. firstObject = this;
  14. }
  15. public:
  16. static God* BuildGod()
  17. {
  18. if (firstObject != NULL)
  19. return firstObject;
  20. else {
  21. God();
  22. return firstObject;
  23. }
  24. }
  25.  
  26. operator const char*() { return "sup"; }
  27. };
  28.  
  29. God* God::firstObject;
  30.  
  31. int main() {
  32. God* a = God::BuildGod();
  33. std::cout << (const char*)(*a);
  34. return 0;
  35. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
sup