Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-11-28 20:39:50


"Arkadiy Vertleyb" <vertleyb_at_[hidden]> writes:

> Actualy I meant using select1st in lambda expressions that are passed to
> algorithms... From your explanation, select1st<> with no parameters is a
> metafunction class that gets the "first" typedef from the type passed. But
> what if we have to use it in a combination with something else, say in
> iter_fold. We don't have the type there -- we have an iterator. So, in
> this case we can't use select1st<> with default parameter -- we have to
> supply the parameter, something like:
>
> select1st<deref<_1> >
>
> And this again will complain about lack of "first" typedef in deref (in
> VC6.5)

Arkadiy,

Please see http://www.boost.org/more/discussion_policy.htm#quoting

<snip long quote>

What Aleksey was suggesting was that you don't use lambda
expressions, but apply bind, etc., yourself.

     bind1<select1st<>, bind1<deref<>,_1> >

Lambda expressions have some limitations on broken platforms, even
with the workarounds. You've simply run into one of them.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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