I have a system which handles arbitrary types, and to be able to
invoke the correct functions I use type erasure with a void* argument.
This works dandy most of the time, save for when the type inherits
from multiple types, in which case it naturally fails spectacularly.
So, somehow I must either change the interface to not use void*, in
which case I have problems to create a valid base to overload. Or,
somehow automatically at runtime correctly patch the pointer so that
the cast succeeds. I'm using std::typeinfo already, so that could
perhaps be passed along and inspected, but I can't seem to find any
functionality to do something useful with the typeinfo save for
testing against it and printing the name. Would love to get some
suggestions for a clean solution which hopefully doesn't require to
much explicitly provided information from client code.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Try Boost.Any.
Sebastian