Skip to content

Instantly share code, notes, and snippets.

@njlr
Created September 19, 2017 11:14
Show Gist options
  • Save njlr/ea3e7dfe47ffc9e97dc3e2fdcb128810 to your computer and use it in GitHub Desktop.
Save njlr/ea3e7dfe47ffc9e97dc3e2fdcb128810 to your computer and use it in GitHub Desktop.
struct Functor {
// The context, or capture
  // For example, an int and an unsigned
  int i;
  unsigned N;
// The lambda
  int operator() (int j) const {
 // For example, a small math function
  return i * j + N;
  }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment