Hi, I don't have  been here for a long long time, just like a year. Today, I learn a new operator boost::bind, from the open-source C++ Libraries BOOST. Boost::bind is to bind arguments with a "thing" like the function, and run it like a real function. Following is the example:
1.bind free function
int add(int x, int y){ return x+y ;}
add(1, 2)
<===> boost::bind(add, 1, 2);
add(x, y) <===> boost::bind(add,
_1, _2)(x, y);
add(x, x) <===> boost::bind(add, _1, _1)(x, y);


2.bind functor
int operator()(int a, int b)(return a - b;)
bool operator()(long a, long b) {return a == b;}
F f;
int x =
104;
bind<int>(f, _1, _1)(x);
bind<int>(F(), _1, _1)(X);
3
bind class method
struct X
{
 bool f(int a);
};
sample code:
X x;
shared_prt<X> p = new X;
int i(5);
bind(&X::f, boost::ref(x), _1)(i);// x.f(i)
bind(&X::f, x, _1)(i);// x_copy = x, x_copy.f(i), less effective than the one above
bind(&X::f, &x, _1)(i);// (&x)->f(i);
bind(&X::f, p, _1)(i);// smart pointer , p_copy = p, p_copy.f(i);

4. a question what''s the return value ?
EX. bind(add, bind(add, 1,2), bind(add, 1, 2));