#include <set>
#include <vector>
#include <iostream>
#include <boost/timer.hpp>
#include <boost/lexical_cast.hpp>
Go to the source code of this file.
◆ main()
Definition at line 14 of file bug.cpp.
15{
16 std::size_t niters = argc < 2 ? 1000 : boost::lexical_cast<std::size_t>(
argv[1]);
17
19
21 for (
int n = 0;
n < niters; ++
n)
22 {
23 v.insert(
v.begin() +
v.size()/2,
n);
24 }
25
26 std::cout <<
"vector fill: " <<
t.elapsed() << std::endl;
27
28 std::multiset<int*,compare>
m;
29 for (
int n = 0;
n < niters; ++
n)
30 {
32 }
33 std::cout <<
"map fill 1: " <<
t.elapsed() << std::endl;
34 for (
int n = 0;
n < niters; ++
n)
35 {
37 }
38 std::cout <<
"map fill 2: " <<
t.elapsed() << std::endl;
39}