#include #include typedef boost::container::flat_multimap IntMap; class MapTest { public: MapTest() {} MapTest(IntMap const &map) : _map(map) { _map.insert(map.begin(), map.end()); } IntMap const& getMap() {return _map; } private: IntMap _map; }; int main(int argc, char *argv[]) { using std::cout; using std::endl; IntMap iMap; for(int i = 0; i < 1000; i++) { iMap.emplace(i, i); } MapTest map(iMap); for(auto const &kvPair : map.getMap()) { cout << kvPair.first << " : " << kvPair.second << endl; } return 0; }