Providing a definition for a pure virtual function is not necessarily meaningless. Marking a pure virtual function means that the enclosing class is abstract and that any class that derives from it is abstract if the final override for this function is not a pure virtual function. A pure virtual function can still be called via an explicit non-virtual call.
In the body of the constructor of the base class (but not from the ctor initializer), the version of the virtual function that is called through the virtual call is defined in the class itself or in one of its bases, and not in the class that overrides it (which has not yet been built). This is explicitly stated in 12.7 [class.cdtor] / 3.
It is legal to uniquely call a pure virtual function in the constructor body (i.e. using an explicit classifier) ββ- although this would require the function to have a specific body, undefined behavior calls a pure virtual function through a virtual call, which is possible only from the constructor or destructor abstract class. This is explicitly stated in 10.4 [class.abstract] / 6.
Charles Bailey
source share