fork(1) download
  1. class Test
  2. {
  3. public:
  4. Test();
  5. ~Test();
  6. };
  7.  
  8. #include <memory>
  9.  
  10. class Test;
  11.  
  12. class Trouble
  13. {
  14. public:
  15. Trouble();
  16.  
  17. private:
  18. std::auto_ptr<Test> Test_;
  19. };
  20.  
  21. int main(int argc, char* argv[])
  22. {
  23. Trouble trouble;
  24. return 0;
  25. }
  26.  
  27. Trouble::Trouble()
  28. : Test_(new Test())
  29. {
  30. }
  31. #include <stdio.h>
  32. Test::Test()
  33. {
  34. printf("Test()\n");
  35. }
  36.  
  37. Test::~Test()
  38. {
  39. printf("~Test()\n");
  40. }
Success #stdin #stdout 0s 3028KB
stdin
Standard input is empty
stdout
Test()
~Test()