How to add event listners / signals to a simple superman class?
- by Kabumbus
I can and would love to use boost or std for this. Sorry - I am new to C++. So I created a really simple program like:
#include <iostream>
#include <string>
using namespace std;
class superman
{
public:
string punch(){return cout << "superman: I hit the bad guy!" << endl;};
};
int main()
{
superman clark;
clark.punch();
cin.get();
}
I want to add an event listner that would tell me when clark punched and cout something like "superman punched!". How to add such event listner and event function to my class?