Skip to content

Instantly share code, notes, and snippets.

@chiiph
Last active December 10, 2015 03:28
Show Gist options
  • Select an option

  • Save chiiph/4374879 to your computer and use it in GitHub Desktop.

Select an option

Save chiiph/4374879 to your computer and use it in GitHub Desktop.
int nonModifiable = 42;
int modifiable = 23;
auto myLambda = [=, &modifiable]() mutable { modifiable++; nonModifiable++; };
myLambda(); // modifiable == 24, nonModifiable == 42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment