fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. struct S {
  5. S(const char* v_) : m_v(v_) {}
  6. ~S() {
  7. std::cout << "destructing ~S(" << m_v << ")\n";
  8. }
  9. const char* m_v;
  10. };
  11.  
  12. int main()
  13. {
  14. std::vector<S*> v;
  15. v.push_back(new S("hello"));
  16. v.clear();
  17.  
  18. v.push_back(new S("fin"));
  19. }
  20.  
Success #stdin #stdout 0s 3268KB
stdin
Standard input is empty
stdout
Standard output is empty