fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. struct TestClass
  5. {
  6. TestClass()
  7. {
  8. std::cout << "default ctor" << std::endl;
  9. }
  10. TestClass(const TestClass &)
  11. {
  12. std::cout << "copy ctor" << std::endl;
  13. }
  14. };
  15.  
  16. int main()
  17. {
  18. std::vector<TestClass> v (5);
  19. }
Success #stdin #stdout 0s 2984KB
stdin
Standard input is empty
stdout
default ctor
copy ctor
copy ctor
copy ctor
copy ctor
copy ctor