fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. struct test {
  5. test() { std::cout << "test()" << std::endl; }
  6. test(const test &) { std::cout << "test(copy)" << std::endl; }
  7. test(test && ) { std::cout << "test(move)" << std::endl; }
  8. ~test() { std::cout << "~test()" << std::endl; }
  9. };
  10.  
  11. int main() {
  12. std::vector<test> vec1;
  13. for (auto i = 0; i < 10; ++i) {
  14. vec1.emplace_back();
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
test()
test()
test(copy)
~test()
test()
test(copy)
test(copy)
~test()
~test()
test()
test()
test(copy)
test(copy)
test(copy)
test(copy)
~test()
~test()
~test()
~test()
test()
test()
test()
test()
test(copy)
test(copy)
test(copy)
test(copy)
test(copy)
test(copy)
test(copy)
test(copy)
~test()
~test()
~test()
~test()
~test()
~test()
~test()
~test()
test()
~test()
~test()
~test()
~test()
~test()
~test()
~test()
~test()
~test()
~test()