Suppose I have a function that takes some kind of predicate:
void Foo( boost::function<bool(int,int,int)> predicate );
If I want to call it a predicate that always returns true, I can define a helper function:
bool AlwaysTrue( int, int, int ) { return true; }
...
Foo( boost::bind( AlwaysTrue ) );
But is there really a call to this function (possibly using boost :: lambda) without the need to define a separate function?
[Edit: forgot to say: I CANNOT use C ++ 0x]
source
share