mardi 19 novembre 2019

Cannot understand C++ map syntax

I don't understand the constructor statement in the following code. How can the iterator to the past-of-end element be added to the map as a key?

template<typename K, typename V>
class my_map {
    std::map<K,V> m_map;

public:
    my_map( V const& val) {
        m_map.insert(m_map.end(),std::make_pair(std::numeric_limits<K>::lowest(),val));
    }
};

Aucun commentaire:

Enregistrer un commentaire