Andrei Alexandrescu wrote:
> Rainer Deyke wrote:
>> Composition instead of inheritance?  Doesn't work if I need virtual
>> functions.
> 
> This is going in circles. You started from "implementation inheritance
> of value types, even without actual polymorphism".

Yes, but implementation inheritance may involve customization points.
Virtual functions are one of of providing this customization.  The
curiously recurring template pattern provides another way.  Either way,
the class looks like a non-polymorphic value type from the outside.

Simple composition does *not* work here, unless the inner component has
a pointer to the outer aggregate.


-- 
Rainer Deyke - [email protected]

Reply via email to