title: C++: How to build an events / messaging system without void pointers?
body: <p>I'd like to have a dynamic messaging system in my C++ project, one where there is a fixed list of existing events, events can be triggered anywhere during runtime, and where you can subscribe callback functions to certain events.</p>
  
  <p>There should be an option for arguments passed around in those events. For example, one event might not need any arguments <code>(EVENT_EXIT)</code>, and some may need multiple ones <code>(EVENT_PLAYER_CHAT: Player object pointer, String with message)</code></p>
  
  <p>The first option for making this possible is allowing to pass a void pointer as argument to the event manager when triggering an event, and receiving it in the callback function.</p>
  
  <p>Although: I was told that void pointers are unsafe and I shouldn't use them.</p>
  
  <ul>
  <li>How can I keep (semi) dynamic argument types and counts for my events whilst not using void pointers?</li>
  </ul>