Last active
August 30, 2015 02:10
-
-
Save thiagomg/f79848f06a939b7fa4b7 to your computer and use it in GitHub Desktop.
Lambda - Functor
This file contains 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
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