fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. class Foo {
  6. public:
  7. Foo() { cout << "ctor()\n"; }
  8. ~Foo() { cout << "dtor()\n"; }
  9. Foo(const Foo&) { cout << "cctor()\n"; }
  10. };
  11.  
  12. int main() {
  13. vector<Foo> v;
  14. v.push_back(Foo());
  15. cout << "xxx\n";
  16. return 0;
  17. }
Success #stdin #stdout 0s 3228KB
stdin
Standard input is empty
stdout
ctor()
cctor()
dtor()
xxx
dtor()