Boost logo

Boost Users :

From: Jaakko Jarvi (jarvi_at_[hidden])
Date: 2006-11-30 13:03:50


On Nov 30, 2006, at 11:38 AM, Noah Roberts wrote:

> On 11/30/06, Joaquín Mª López Muñoz <joaquin_at_[hidden]> wrote:
>
>>> bind( &deref_val_type::f, *_1 ) == 5 may work with Lambda.
>>
>> Almost: the translation of the expression to the lambda world, i.e.
>>
>> l::bind( &deref_val_type::f, *l::_1 ) == 5
>>
>> (assuming namespace l = boost::lambda) fails to compile because
>> it indices the declaration of
>>
>> boost::tuples::cons<deref_val_type, boost::tuples::null_type>::head
>>
>> which is not instantiable deref_val_type is abstract.
>
> Right, works fine until working with abstract types. Kind of
> frustrating to toss it into a test with mock objects and not realize
> you also need to test that your algorithms work with abstract
> interfaces.
>
> The closest I
>> can get in BLL to your formulation is:
>>
>> l::bind( &deref_val_type::f, &*l::_1 ) == 5
>>
>> which works as expected.
>
> Yep, that works. Not exactly what I wanted to see, and I should have
> thought of it, but there it is. I think this is something the lambda
> folks might want to work on as it isn't exactly favorable (is it in
> the works?).

On the list... needs a non-trivial amount of changes

   Jaakko

> Bind is a lot easier to work with because it catches on.
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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