#include #include #include #include // templated alias to vector<> template using vec = std::vector; struct MyThing{ int idat; vec x; MyThing(int idat_, vec x_) noexcept : idat{idat_},x{x_}{} }; int main(){ using clock = std::chrono::steady_clock; using std::chrono::milliseconds, std::chrono::duration_cast; const int N=1000000; auto t0 = clock::now(); std::vector v; for (auto i=0;i{1.0,2.0,3.0,4.0,5.0,6.0})); } auto t1 = clock::now(); auto d = duration_cast(t1-t0); std::cout <<"vector push_back took: "< w; t0 = clock::now(); for (auto i=0;i{1.0,2.0,3.0,4.0,5.0,6.0}); } t1 = clock::now(); d = duration_cast(t1-t0); std::cout <<"vector emplace_back took: "<