fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. struct Bar
  6. {
  7. Bar(int, const string&) {}
  8. };
  9.  
  10. class Foo
  11. {
  12. public:
  13. Foo() : bar(new Bar(12345, "string")) {}
  14.  
  15. private:
  16. Bar *bar;
  17. };
  18.  
  19. int main()
  20. {
  21. Foo foo;
  22. cout << "OK" << endl;
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0s 3228KB
stdin
Standard input is empty
stdout
OK