Created
August 13, 2012 23:29
-
-
Save dcolish/3344814 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #include <functional> | |
| #include <iostream> | |
| using namespace std::placeholders; | |
| int add(int a, int b) { | |
| return a + b; | |
| } | |
| int main () { | |
| auto add1 = std::bind(std::plus<int>(), _1, 2); | |
| std::cout << add1(2) << std::endl; | |
| return 0; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment