Skip to content

Instantly share code, notes, and snippets.

@szolotykh
Created September 19, 2015 02:56
Show Gist options
  • Save szolotykh/1026337560aec8091eb1 to your computer and use it in GitHub Desktop.
Save szolotykh/1026337560aec8091eb1 to your computer and use it in GitHub Desktop.
Check.cpp
#include <iostream>
#include <functional>
class P
{
public:
std::function<void(int)> check = [this](int a)
{
std::cout << "Check 1: " << a << "\n";
check = [this](int a)
{
std::cout << "Check 2: " << a << "\n";
};
};
};
int main()
{
P p;
p.check (10);
p.check (20);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment