Boost logo

Boost Users :

From: Alan M. Carroll (amc_at_[hidden])
Date: 2007-01-16 20:17:30


At 06:31 PM 1/16/2007, Peter Dimov wrote:
>I assumed that writing bind<R&>
>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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net