fork download
  1. #include <iostream>
  2. #include <memory>
  3. using namespace std;
  4.  
  5. struct T
  6. {
  7. void foo() {}
  8. };
  9.  
  10. int main() {
  11. auto a1 = new T;
  12. a1->foo();
  13.  
  14. auto a2 = make_shared<T>();
  15. a2->foo();
  16.  
  17. auto a3 = make_unique<T>();
  18. a3->foo();
  19. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
Standard output is empty