Skip to content

Instantly share code, notes, and snippets.

@swkwon
Last active August 29, 2015 14:19
Show Gist options
  • Save swkwon/88e406e515e6bf3f35c8 to your computer and use it in GitHub Desktop.
Save swkwon/88e406e515e6bf3f35c8 to your computer and use it in GitHub Desktop.
std::vector<std::function<void()>> fs;
class Widget
{
public:
void get_func()
{
fs.emplace_back([=]()
{
std::cout << member << std::endl;
});
}
private:
int member;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment