Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-03-20 00:46:01


----- Original Message -----
From: "Peter Dimov" <pdimov_at_[hidden]>
> From: "rogeeff" <rogeeff_at_[hidden]>
> > --- In boost_at_y..., "Peter Dimov" <pdimov_at_m...> wrote:
> > >
> > > std::vector< boost::shared_ptr<X> > v;
> > > std::for_each( v.begin(), v.end(), boost::bind(&X::f, _1) );
> >
> > How will it look like with LL?
>
> Actually now that I think about it, this is probably a non-issue since
LL
> will just use bind(&X::f, *_1). This covers most of the cases. Thanks.
>
> > How will it look like with LL? I.e. how to define binary function
> > like this:
> > f(x,y) = g(x,x)?
>
> (_2, bind(g, _1, _1))

I am inclined to agree with Peter about most everything he posted
including the weight of the library, but most especially about this
issue. It seems to me that the design of LL may not be well-matched to
the needs of users. My experience with lambda expressions in other
languages is that once the expression reaches a certain complexity, it
makes far more sense to break the expression out into a separate
function. Simple non-jobs like dropping an argument shouldn't require
extra notational support: that just pushes users closer to the place
where they're forced to debate whether or not to use the library
facilities.

-Dave


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk