Here is an example using unions. Notice that we lost ability to use non-trivial types in events. http://coliru.stacked-crooked.com/a/51a94757c12a7d2f
It will be better to actually have type-safe templated event handling mechanism, but I do not have time for it right now.
I haven't tried boost yet
I strongly suggest to try. It is really useful library.
i read that installing and configuring for mingw and codeblock is a pain.
Where path to boost is path to the boost package (ending with directory like \boost_1_54_0)
You need -isystem to include boost libraries as system ones. It is done to suppress warnings in boost headers because they can break C::B.