
On 9/2/07, Dean Michael Berris <mikhailberis@gmail.com> wrote:
Hi Tobias!
On 9/2/07, Tobias Schwinger <tschwinger@isonews2.com> wrote:
Though it is interesting -- I've been playing around with the idea of an overloaded type-safe dispatcher for some time, but I never got to thinking of a way to accomplish it in a clean manner. Basically something that will allow the following:
A possible way, as implemented in my example, is to use a multi-valued map (std::multimap) to store keys so that for each key value you get a set of objects. The second step is to store corresponding signature in the object "as the object type" so that you can check for correct signature with a dynamic_cast<> of stored objects against the dispatch request. Anyhow "simple_factory.hpp" code is much clear then the above explanation... ;-) Marco