Skip to content

Instantly share code, notes, and snippets.

@swkwon
Created April 22, 2015 06:00
Show Gist options
  • Save swkwon/abc9759e8f8a1a605154 to your computer and use it in GitHub Desktop.
Save swkwon/abc9759e8f8a1a605154 to your computer and use it in GitHub Desktop.
std::vector<std::function<void()>> fs;
class Widget
{
public:
void get_func()
{
int m = this->member;
fs.emplace_back([m]()
{
std::cout << m << std::endl;
});
}
private:
int member;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment