This is because, in addition to overriding the base, Expand()you also hide the base Expand(bool).
When you enter a member function in a derived class with the same name as the method from the base class, all methods of the base class with this name are hidden in the derived class.
( ), using:
class B : public A
{
public:
using A::Expand;
virtual void Expand() {
A::Expand(true);
Expand(true);
}
};