Created
June 21, 2013 20:30
-
-
Save remram44/5834100 to your computer and use it in GitHub Desktop.
http://paulgraham.com/accgen.html in C++11
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 <functional> | |
| std::function<int (int)> foo(int n) | |
| { | |
| return [=](int x) mutable { return n += x; }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment