Created
February 12, 2019 03:36
-
-
Save devendranaga/8270c9019c85b45745f0e48c8de715a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <functional> | |
void f() | |
{ | |
std::cout << "called f" << std::endl; | |
} | |
int main() | |
{ | |
// declare the cb of type std::function | |
std::function<void(void)> cb; | |
cb = f; | |
// call the callback | |
cb(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment