Boost logo

Boost :

Subject: Re: [boost] [intrusive] rtti_base class proposition
From: Ireneusz Szpilewski (irek_at_[hidden])
Date: 2009-10-22 01:31:42


Matus Chochlik wrote:
> I agree that defining and using a common base class for all other classes
> in a project is in 99% of cases a very bad idea. There is a book called
> "C++ Gotchas: Avoiding Common Problems in Coding and Design"
> and the use of such "cosmic hierarchies" is a gotcha #97 ;-)
>
> How would you model in C++ such situation:
there is a Factory making plastic Cats and Dogs. They make some cats and
dogs
every day. Truck drivers arrive from time to time and get new products for
further processing. Plastic cats and dogs are not sorted by the factory,
they
are mixed together and have the same price.

How the factory should be modeled?

struct Factory
{
    ?
};

Ireneusz Szpilewski


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk