[Solved] How do I achieve the equivalent of type shadowing by a derived class?
So, if this is just a thought-experiment, then the answer is “You can’t do that”. If you actually want a hierarchy where your derived classes have different types, you could do something like this: class Base { public: virtual void bar() = 0; }; class A: public Base { public: void bar() { … do … Read more