
Dean Michael Berris said: (by the date of Thu, 19 Oct 2006 17:09:02 +0800)
can it be used for multimethods ?
I have an example use (in the accompanying tests) which uses a boost::tuple<> as the index type. If the aim was to use multiple values, you can create a tuple from it and use that as an index -- then couple it with a validation and routing strategy that allows you to validate and manipulate the index used for the dispatch.
If you need to call multiple methods, you can use the invoker interface to the dispatcher -- but still using single dispatch. You can even use Boost.Signals to register a set of methods and register it to the dispatcher on a single index.
thanks, I will check it out. I have one question though. Currently I am using a 2D matrix to preform dispatching on two virtual base classes. This matrix approach allows fast lookup. Does your method allow a similar solution? -- Janek Kozicki |