Boost logo

Boost :

Subject: Re: [boost] Boost.Multimethod proposal
From: Nicholas Howe (nicholas.howe_at_[hidden])
Date: 2009-08-22 19:19:44

On Sat, Aug 22, 2009 at 5:03 AM, Andrey Semashev

> I'm definitely interested. What is the complexity of calling a multimethod?
> Is the code and some examples available somewhere?

I've uploaded the code to the vault in It's got
several examples of varying complexity. It currently favors VC8. I added a
very basic makefile for the simplest example in
Multimethod\MultipleDispatch\Test and was able to build it using MinGW.
 However, you'll probably have to modify it if you want to build. It's been
a while since I last made a makefile. The classes aren't in the boost
namespace and don't follow Boost's naming conventions at this point.

In my implementation, the best method to call for a combination of types is
calculated and cached in an unordered_map the first time the types are
encountered. The complexity of subsequent calls with the same types is the
same as for unordered_map. I'm not sure what the complexity of the first
call is. I guess it's something like number-of-bases-per-parameter
^ number-of-parameters or worse.

Boost list run by bdawes at, gregod at, cpdaniel at, john at