Code:
find_if( v1.begin( ), v1.end( ),
not1(bind2nd( mem_fun_ref( &string::find) , string("bleh")) ));
I keep getting compiling error for that statement above because string::find is overloaded and the compiler can't resolve which version to use. Does anyone know how to use it without having to static_cast it?
Edit:
I wrote a functor to incapsulate the value being compared to
Code:
struct strFind: private std::string
{
strFind(std::string in) : std::string(in) {}
bool operator() (const std::string & input) const
{
return !compare(input);
}
};
...
int main()
{ ...
pos = find_if( v1.begin( ), v1.end( ),strFind("pearly") );
}
wonder what's the limit of this method is.