Skip to content

Instantly share code, notes, and snippets.

@godfat
Created March 7, 2014 07:04
Show Gist options
  • Save godfat/9406676 to your computer and use it in GitHub Desktop.
Save godfat/9406676 to your computer and use it in GitHub Desktop.
// 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