ReactOS  0.4.15-dev-5499-g1341c38
bug.cpp File Reference
#include <set>
#include <vector>
#include <iostream>
#include <boost/timer.hpp>
#include <boost/lexical_cast.hpp>
Include dependency graph for bug.cpp:

Go to the source code of this file.

Classes

struct  compare
 

Functions

int main (int argc, char const *const argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char const *const  argv[] 
)

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 
18  boost::timer t;
19 
20  std::vector<int> v;
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  {
31  m.insert(&v[n]);
32  }
33  std::cout << "map fill 1: " << t.elapsed() << std::endl;
34  for (int n = 0; n < niters; ++n)
35  {
36  m.insert(&v[n]);
37  }
38  std::cout << "map fill 2: " << t.elapsed() << std::endl;
39 }
GLdouble n
Definition: glext.h:7729
GLdouble GLdouble t
Definition: gl.h:2047
#define argv
Definition: mplay32.c:18
const GLfloat * m
Definition: glext.h:10848
#define cout
Definition: iostream.cpp:38
basic_ostream< _CharT, _Traits > &_STLP_CALL endl(basic_ostream< _CharT, _Traits > &__os)
Definition: _ostream.h:357
__kernel_size_t size_t
Definition: linux.h:237
const GLdouble * v
Definition: gl.h:2040