Boost logo

Boost :

From: Hamish Mackenzie (hamish_at_[hidden])
Date: 2002-11-27 07:40:34


On Tue, 2002-11-26 at 20:55, Boris Schäling wrote:
> > * should not require virtual base class interface
>
> What does this mean? No polymorphism?!

No, it just means templates (compile time polymorphism).

Higher levels can add virtual functions but we shouldn't need them in
the lower layers. Even in the higher levels virtual functions should be
optional.

Consider the your socket multiplexor design. We could use templates
something like this...

template< typename ObserverType = observer >
class multiplexor{ ... }

Then the user is free to derive from observer if they want to have
runtime polymorphism or replicate the observer interface with non
virtual functions and use it to instantiate the multiplexor.

-- 
Hamish Mackenzie <hamish_at_[hidden]>

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