Boost logo

Boost :

Subject: Re: [boost] Boost.Multimethod proposal
From: Jeffrey Bosboom (jbosboom_at_[hidden])
Date: 2009-08-22 23:01:34


Edward Diener wrote:
> What is a practical use for multi-methods ?

Multimethods (assuming this library uses the term as it's commonly
understood) are like virtual functions that are dispatched on the
dynamic types of their arguments as well as the type of *this. You can
get this effect through double dispatch, but it requires a bit of
plumbing and requires two virtual calls (which for some people is a
large amount of overhead). (Of course, multimethods have overhead too.)

There's a Stroustrup et al paper on the feasibility of adding
multimethods to C++ here: http://research.att.com/~bs/multimethods.pdf .
I'm not sure how relevant it is to the current proposal, but it contains
information on an experimental implementation that was faster than
double dispatch.

--Jeffrey Bosboom


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