If you like, prepare me some simple example and I can correct it or help you at this point. With Kind Regards, Ovanes Markarian On Tue, June 26, 2007 14:56, Lukasz wrote:
You summed it up very well with the first paragraph. I've been trying to template this from the beginning, but it just wouldn't fit into the design. However, i think i'll be able to use variant within one of my maps to store the "real" type of the event which should work perfectly for my needs. Thanks for all the input... it really helped to get some ideas together and variant will probably do the trick (but i still have to fiddle some more with the idea).
Thanks again.
Lukasz K.
Ovanes Markarian wrote:
My idea is based on fact that you (program developer or another developer) know what is going to be send. What you are trying to do is erasing the type to some base and that would not work.
So you send event must handle derived type and put it correctly to variant. A possible solution would be:
template<class EventType_> void sendEvent(EventType_ const& ev) { m_eventContainer = ev; //<- now compiler knows exactly the type of ev m_derivedHelper->dispatchEvent(&m_eventContainer); }
Best Regards, Ovanes
[...]