fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. struct obj
  5. {
  6. std::string name;
  7. int age;
  8. float money;
  9.  
  10. obj():name("NO_NAME"),age(0),money(0.0f){}
  11. obj(const std::string& _name, const int& _age, const float& _money):name(_name),age(_age),money(_money){}
  12.  
  13. obj(obj&& tmp): name(std::move(tmp.name)), age(std::move(tmp.age)), money(std::move(tmp.money)) {}
  14. obj& operator=(obj&&) {return *this;}
  15.  
  16. };
  17.  
  18. int main(int argc, char* argv[])
  19. {
  20. std::vector<obj> v;
  21. for( int i = 0; i < 5000000; ++i )
  22. {
  23. v.emplace_back("Jon", 45, 500.6f);
  24. }
  25. return(0);
  26. }
Success #stdin #stdout 1.39s 120128KB
stdin
Standard input is empty
stdout

Standard output is empty