1: You should be extremely careful when building containers of the C ++ standard library. This can be done, but since they do not have virtual destructors and other similar subtleties, this is usually the wrong approach.
2: Overload rules here are a bit fancy. The compiler first searches for the derived class, and if it detects any overload with the same name, it stops looking there. It looks only in the base class if no overloads were found in the derived class.
A simple solution is to enter the functions you need from the base class into the namespace of the derived class:
class A : public std::multimap<int, bool> { public: using std::multimap<int, bool>::erase;
Alternatively, of course, you could just write a small helper function in a derived class, redirecting to a base class function
source share