In accordance with the standard:
The return type of an overriding function must either be identical to the return type of an overridden function, or covariant with function classes. If the function D :: f overrides the function B :: f, the returned function types are covariant if they satisfy the following criteria:
- both are class pointers or class references
- B:: f , D:: f , D:: f D
- cv-, D:: f cv-, cv-qualification, B:: .
, ( ), Ptr<B> Ptr<A> .
, foo virtual Ptr<A> Ptr<B> B . / , - Cem Kalyoncu .