
On Sat, Aug 22, 2009 at 5:03 AM, Andrey Semashev <andrey.semashev@gmail.com>wrote:
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 Multimethod-0.1.zip. 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. Nick