
On Wed, Jul 28, 2010 at 9:26 AM, Peter Dimov <pdimov@pdimov.com> wrote:
Joel de Guzman wrote:
You might want to re-post this with [bind] in the heading to solicit a reply from Peter Dimov; (maybe CC him too). It's best to fully understand the rationale behind the test.
The test tests whether the constness of the object returned by bind is properly propagated to the bound function object. In the simplest case, bind( f ) should return something like:
struct bound_f { F f_;
void operator()() { return f_(); } void operator()() const { return f_(); } };
In the first op(), called for non-const bound_f objects, the f_ member is non-const. In the second op(), called for const bound_f objects, the f_ member is const.
Thanks for the clarification. I will try to reflect that in phoenix3, if there aren't any objections.