Is there any particular reason why heterogeneous version of erase in associative containers (std::map, std::unordered_map, std::multimap and std::unordered_multimap) takes in a forwarding reference and all other heterogeneous functions (find/equal_range, count, contains) take in const-reference?
For instance in case of std::unordered_map:
template<class K> iterator find(const K& k);
template<class K> const_iterator find(const K& k) const;
template<class K> size_type erase(K&& x);
https://en.cppreference.com/w/cpp/container/unordered_map/erase (overload 4) https://en.cppreference.com/w/cpp/container/unordered_map/find (overloads 3/4)
Section 24.5.4.1 of (lastest working draft) n4910
(This, as mentioned, applies to other containers as well.)