In Why is there no base class in C++?, I quoted Stroustrup on why a common Object class for all classes is problematic in c++. In that quote there is the statement:
Looks like polymorphism to me.
Polymorphism in C++ works when you have indirection; that is, either a pointer-to-T
or a reference-to-T
. Where T
is stored is completely irrelevant.
Bjarne also makes the mistake of saying "heap-allocated" which is technically inaccurate.
(Note: this doesn't mean that a universal base class is "good"!)