Created
March 7, 2014 07:04
-
-
Save godfat/9406676 to your computer and use it in GitHub Desktop.
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
// clang++ -Wall -pedantic -std=c++11 -stdlib=libc++ bind.cpp | |
#include <iostream> | |
#include <functional> | |
using std::cout; | |
using std::endl; | |
using std::bind; | |
using std::placeholders::_1; | |
using std::placeholders::_2; | |
using std::placeholders::_3; | |
void f(int a, int b, int c){ | |
cout << a << " " << b << " " << c << endl; | |
} | |
int main(){ | |
bind(f, _3, _1, _2)(1, 2, 3); // 3 1 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment