
12 Apr
2006
12 Apr
'06
8:42 p.m.
On Behalf Of Peter Dimov
What I really want is this:
What I really want to be able to do is everything I can do in Haskell, but in C++ :) I'm very grateful for Boost.Lambda but language support is needed to make it fully functional (pun not intended).
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() ); }
I like local functions, but one problem I see with this is that it can't work in a template. If you make f a template it will be ambiguous without a cast or something. If only we could pass functions by name.