|
Boost : |
From: Michiel Salters (michiel.salters_at_[hidden])
Date: 2002-06-03 08:41:09
> -----Original Message-----
> From: Yitzhak Sapir [mailto:yitzhaks_at_[hidden]]
> Sent: maandag 3 juni 2002 15:09
> To: boost_at_[hidden]
> Subject: RE: [boost] Proposal for Extensible Any
>
>
> I think for a general case, it would be better to have a
> virtual function "visit" that receives a visitor functor
> whose type is templated by the template parameter of the
> "templated any type", runs the functor on the data of the
> holder, and returns the resultant functor.
I'm confused. What class should define the virtual function; and how does
a virtual function accept an unknown type? Templates and virtuals don't mix
well; templates define an potentially unbounded set of functions and vtables
contain a fixed number of functions.
You could still implement visitior using the techniques from MC++D, though,
it just works differently ( with typelist, as you mentioned).
Regards,
-- Michiel Salters Consultant Software Engineering CMG RTSE1 Michiel.Salters_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk