You cannot call a pure virtual function from the constructor. At runtime, the constructor object is considered to be a constructed type, and not a derived type. This means that virtual dispatching "stops" when the type is built.
, fill()
a
a::fill()
, - , a
. , , , .
, @KerrekSB, . undefined, - delete
a b
a
( shared_ptr<a>
).
UPDATE. -, shared_ptr
, , . , , std::shared_ptr
; - , ( ). .