Skip to content

Instantly share code, notes, and snippets.

@thiagomg
Last active August 30, 2015 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thiagomg/f79848f06a939b7fa4b7 to your computer and use it in GitHub Desktop.
Save thiagomg/f79848f06a939b7fa4b7 to your computer and use it in GitHub Desktop.
Lambda - Functor
Functor:
template<typename T>
class F {
T &_b;
public:
F(T &b) : _b(b) { }
auto operator()(T v) {
return v * _b;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment