Ticket #9108: sandbox.cpp

File sandbox.cpp, 659 bytes (added by adam.m.baxter@…, 9 years ago)

Reproducer program

Line 
1#include <iostream>
2#include <boost/container/flat_map.hpp>
3
4typedef boost::container::flat_multimap<int,int> IntMap;
5
6class MapTest {
7public:
8 MapTest() {}
9 MapTest(IntMap const &map) :
10 _map(map) {
11 _map.insert(map.begin(), map.end());
12 }
13 IntMap const& getMap() {return _map; }
14private:
15 IntMap _map;
16};
17
18int main(int argc, char *argv[]) {
19
20 using std::cout;
21 using std::endl;
22
23 IntMap iMap;
24 for(int i = 0; i < 1000; i++) {
25 iMap.emplace(i, i);
26 }
27
28 MapTest map(iMap);
29 for(auto const &kvPair : map.getMap()) {
30 cout << kvPair.first << " : " << kvPair.second << endl;
31 }
32 return 0;
33}
34