std::map has the member function
template <class P> pair<iterator,bool> insert (P&& val);
which we use e.g. like so:
my_map.insert(std::make_pair(k, v));
Question is, why isn't there a variant of insert()
which just takes a key and a value, i.e.
pair<iterator,bool> insert (K&& key, V&& value);
(with K and V being the template parameters of the map of course) which we would use e.g. like so:
my_map.insert(k, v);
That seems to me perfectly reasonable to have.