from the BLL/bind documentaion on the cvs:
struct A {
// the return type equals the third argument type:
template
T3 operator()(const T1& t1, const T2& t2, const T3& t3);
template <class Args>
class sig {
// get the third argument type (4th element)
typedef typename
boost::tuples::element<3, Args>::type T3;
public:
typedef typename
boost::remove_cv<T3>::type type;
}
};
To begin with this piece of code has 2 syntax errors.
template // should have class before all parameters
struct sig {
...
} // missing semicolon
If a first time user copy/pastes the example, fixes the syntax errors,
defines operator() and tries to call the function with:
int i = 7;
bind( A(), 1, 2, _1) (i);
she gets a hard to parse error because operator() wasn't declared const.
I see two possible solutions:
1) Add const to the declaration
2) mention the non constness and show how to call the function
object using var(func), with a short note on why that is needed.