
12 Apr
2006
12 Apr
'06
9:01 p.m.
"Peter Dimov" <pdimov@mmltd.net> 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