#include <iostream>
#include <map>

template <typename MapType>
class map_add_values {
private:
    MapType mMap;
public:
    typedef typename MapType::key_type KeyType;
    typedef typename MapType::mapped_type MappedType;
    
    map_add_values(const KeyType& key, const MappedType& val)
    {
        mMap[key] = val;
    }
    
    map_add_values& operator()(const KeyType& key, const MappedType& val) {
        mMap[key] = val;
        return *this;
    }
    
    void to (MapType& map) {
        map.insert(mMap.begin(), mMap.end());
    }
};

typedef std::map<int, int> Int2IntMap;

void printMap(const Int2IntMap& map) {
    std::cout << "Contents of Map" << std::endl;
    std::cout << "===============" << std::endl;
    Int2IntMap::const_iterator mapIterator = map.begin(),
        mapIteratorEnd = map.end();
    while (mapIterator != mapIteratorEnd) {
        std::cout << "(" << mapIterator->first << ", " << mapIterator->second << ")" << std::endl;
        ++mapIterator;
    }
    std::cout << std::endl;
}

int main() {
    Int2IntMap testMap;
    map_add_values<Int2IntMap>(1,2)(3,4)(5,6).to(testMap);
    printMap(testMap);
    map_add_values<Int2IntMap>(10,20)(30,40)(50,60).to(testMap);
    printMap(testMap);
}