#include <iostream>
using namespace std;
class Button
{
private:
void (*f_m)();
public:
Button(void (*f)()) : f_m(f) {}
~Button(){}
void operator() () { f_m(); } // meke button a callable (i.e. button() )
};
class Game_Events
{
public:
Button* button;
Game_Events()
{
button = new Button(&Close);
}
~Game_Events(){}
static void Close(){ cout<<"general boum"<<endl;} //I need to pass this function for call it on the other side
};
int main() {
Game_Events e;
(*e.button)();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNsYXNzIEJ1dHRvbgp7CiAgIHByaXZhdGU6CiAgICAgICB2b2lkICgqZl9tKSgpOwogICBwdWJsaWM6CiAgICAgICBCdXR0b24odm9pZCAoKmYpKCkpIDogZl9tKGYpIHt9CiAgICAgICB+QnV0dG9uKCl7fQogICAgICAgdm9pZCBvcGVyYXRvcigpICgpIHsgZl9tKCk7IH0gICAgLy8gbWVrZSBidXR0b24gYSBjYWxsYWJsZSAoaS5lLiBidXR0b24oKSApIAp9OwoKY2xhc3MgR2FtZV9FdmVudHMKewogICAgcHVibGljOgogICAgICAgIEJ1dHRvbiogYnV0dG9uOyAKICAgICAgICBHYW1lX0V2ZW50cygpCiAgICAgICAgewogICAgICAgICAgICBidXR0b24gPSBuZXcgQnV0dG9uKCZDbG9zZSk7CiAgICAgICAgfQogICAgICAgIH5HYW1lX0V2ZW50cygpe30KICAgICAgICBzdGF0aWMgdm9pZCBDbG9zZSgpeyBjb3V0PDwiZ2VuZXJhbCBib3VtIjw8ZW5kbDt9IC8vSSBuZWVkIHRvIHBhc3MgdGhpcyBmdW5jdGlvbiBmb3IgY2FsbCBpdCBvbiB0aGUgb3RoZXIgc2lkZQp9OwoKaW50IG1haW4oKSB7CglHYW1lX0V2ZW50cyBlOyAKCSgqZS5idXR0b24pKCk7IAoJcmV0dXJuIDA7Cn0=