fork(4) download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. struct Object {
  5. Object() { std::cout << "constructor\n"; }
  6. Object(const Object &) { std::cout << "copy constructor\n"; }
  7. Object(Object &&) { std::cout << "move constructor\n"; }
  8. };
  9.  
  10. int main() {
  11. std::vector<Object> v;
  12. v.reserve(10);
  13. v.emplace_back();
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
constructor