Skip to content

Instantly share code, notes, and snippets.

@remram44
Created June 21, 2013 20:30
Show Gist options
  • Select an option

  • Save remram44/5834100 to your computer and use it in GitHub Desktop.

Select an option

Save remram44/5834100 to your computer and use it in GitHub Desktop.
#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