
----- Original Message ----- From: "Stewart, Robert" <Robert.Stewart@sig.com> To: <boost@lists.boost.org> Sent: Thursday, October 22, 2009 5:04 PM Subject: Re: [boost] [intrusive] rtti_base class proposition
Ireneusz Szpilewski wrote:
Joel Falcou wrote:
you just have to have Cat and Dog inherit from FactoryProduct and not from an arbitrary cosmic base class that has no meaning in the model.
OK, lets call it boost::object :-).
You're missing the point. It isn't the name he's faulting. It's the use of a meaningless ABC just to add RTTI support. As I said before, you create an ABC that represents the root of a hierarchy for the given use case, not use a one-size-fits-all ABC.
In this case, as Joel noted, Product is your ABC. Give it appropriate virtual functions and a virtual destructor and create collections of Products to your hearts content. Why would you need a container of Products and Organs (as in body parts) when one belongs to a factory and the other to a hospital? They are unrelated, so they shouldn't derive from a common base class
Because I am a Juggler. OK I give up, thanks :-)