Boost logo

Boost Users :

Subject: Re: [Boost-users] [phoenix] adding const to member_variable bind
From: Joel de Guzman (joel_at_[hidden])
Date: 2008-11-11 21:27:55


Steven Watanabe wrote:
> AMDG
>
> Steven Watanabe wrote:
>> Joel de Guzman wrote:
>>> Thanks, Steven. Please feel free to apply the patch.
>>
>> I've started adding this to bind_member_variable_tests.cpp
>> and I'm running into more problems than I expected. I'll get back to
>> you.
>
> I'm stuck here:
>
> struct x {
> int m;
> };
>
> // instantiates member_variable::result<x>,
> // but calls member_variable::operator()(const x&).
> bind(&x::m, x())();
>
> // instantiates member_variable::result<x> because
> // top level references are stripped.
> bind(&x::m, ref(x));
>
> There is no way for result to distinguish between these cases,
> even though they are different.

Out of curiosity, how does Boost.Bind and Lambda.Bind behave in this
regard?

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net

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