https://ideone.com/hqXsfu
シャッフルされた数列を昇順にinsertした
{
std::vector<int> xs;
auto b = std::chrono::system_clock::now();
std::for_each(v.begin(), v.end(), [&xs](int x) {
auto pos = std::find_if(xs.begin(), xs.end(), [x](int y) { return x < y;});
xs.insert(pos, x);
});
auto e = std::chrono::system_clock::now();
std::cout << std::chrono::duration_cast<std::chrono::milliseconds>(e - b).count() << std::endl;
}
{
std::list<int> xs;
auto b = std::chrono::system_clock::now();
std::for_each(v.begin(), v.end(), [&xs](int x) {
auto pos = std::find_if(xs.begin(), xs.end(), [x](int y) { return x < y;});
xs.insert(pos, x);
});
auto e = std::chrono::system_clock::now();
std::cout << std::chrono::duration_cast<std::chrono::milliseconds>(e - b).count() << std::endl;
}