Syntax:
template <class Operation, class T> binder1st<Operation> bind1st (const Operation& op, const T& x);
bind the first argument of the binary function.
For example:
#include <iostream> using std::cout; #include <algorithm> using std::transform; #include <functional> using std::bind1st; using std::plus; int main(int argc, char **argv) { int a1[]={0,1,2,3,4,5}; const size_t SIZE=sizeof(a1)/sizeof(*a1); transform(a1,a1+SIZE,a1,bind1st(plus<int>(),SIZE)); for(size_t i=0;i<SIZE;i++){ cout<<a1[i]<<" "; } return EXIT_SUCCESS; }