17 Jan
2007
17 Jan
'07
1:17 a.m.
At 06:31 PM 1/16/2007, Peter Dimov wrote:
I assumed that writing bind
won't be that big of a deal in the relatively rare cases where it's needed.
It sure beats not using bind(). I would recommend that the documentation be changed to reflect this, rather than claim compatibility with the .* operator as it does now. E.g. [...] where R is the return type of X::f (for member functions). For data members, the return value is by default (R const&) because the bind() generated functor must have this fixed upon creation, before it is known whether the argument will be const or not. If you need an lvalue, use the return type template argument of bind() to force the return type to be a non-const reference.