Events in C++
<p>I'm not sure how to look for this online... I think they might be called something different in C++</p>

<p>I want to have a simple event system, somthing like</p>

<pre><code>event myCustomEvent;
myCustomEvent.subscribe( void myHandler(string) );
myCustomEvent.fire("a custom argument");
// myHandler prints out the string passed in the first argument


event myNewCustomEvent;
myNewCustomEvent.subscribe( void myNewHandler(int) );
myNewCustomEvent.fire(10);
// myHandler prints 10
</code></pre>

<p>I can do this pretty easily with a simple class -- but when i want to have an event that passes a different type or amount of arguments to the subscriber i have to write, and define an entirely new event class.. I figure there has to be some library, or maybe even something native in Visual C++ 2008 that will work something similar to this. It's basicly just an implementation of the Observer pattern, so it can't be too impossible to do in C++</p>

<p>This really makes me appreciate how nice it is in JavaScript not to have to worry about the arguments you are passing.</p>

<p>Tell me if this is a stupid question.</p>
