Skip to content

Instantly share code, notes, and snippets.

@modamoda
Created November 15, 2013 11:33
Show Gist options
  • Save modamoda/7482996 to your computer and use it in GitHub Desktop.
Save modamoda/7482996 to your computer and use it in GitHub Desktop.
C++ callback example
void CallBackExample::getMyProfileAsync(MyProfileCallback *pfn)
{
Profile profile;
(*pfn)(&profile);
}
typedef void (ProfileCallback)(Profile*);
class CallBackExample {
public:
static void getMyProfileAsync(MyProfileCallback *pfn);
// C++11 Callback
// void addHandler(std::function<void(int)> callback);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment