Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-04-12 17:01:28


"Peter Dimov" <pdimov_at_[hidden]> writes:

> What I really want is this:
>
> void foo( myvec& v, const myset& s, int a )
> {
> // ...
>
> inline bool f( int x ) { return std::abs( x ) < a && s.find( x ) !=
> s.end(); }
>
> v.erase( std::remove_if( v.begin(), v.end(), f ), v.end() );
> }
>
> for obvious readability reasons.

Local functions would be great. I still think we need lambda
expressions to handle the simple

            _1->first < 0

cases, and especially those cases where the function needs or ought to
be templated. I think the syntax should be

  auto(x){ x->first < 0 }

-- 
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