fork(1) download
  1. #include <vector>
  2. #include <memory>
  3. #include <iostream>
  4.  
  5. struct State
  6. {
  7. ~State() { std::cout << " state destructor " << std::endl; }
  8. };
  9.  
  10. int main()
  11. {
  12. std::vector<std::unique_ptr<State>> mStates;
  13. mStates.push_back(std::unique_ptr<State>(new State()));
  14. mStates.pop_back();
  15. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
 state destructor