Boost logo

Boost Users :

From: Rodolfo Lima (rodolfo_at_[hidden])
Date: 2008-07-05 11:04:58

Andy Rushton escreveu:

> Except you've quoted it wrong. The return type of virtual functions must
> always be the same for all classes in the polymorphic hierarchy. This is
> standard C++ polymorphism - always use a pointer to the superclass to
> point to all subclasses. The return type in this case should be A* for
> both cases:

And apparently you've forgotten what covariant return types are :)


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at