Boost logo

Boost Users :

From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2006-11-30 12:38:27


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?). Bind is a lot easier to work with because it catches on.


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