I had been thinking about this, in particular I'd thought about
delegating find to find_if, and in general mapping between those
functions which accept a parameter and those which accept a function
predicate by something like (note: not actual C++ code!)
template<typename T>
struct __equalobject
{
T& __obj;
__equalobject(T& __inobj) : __obj(__inobj)
{}
bool operator()(T& __inobj)
{ return __obj == __inobj; }
};
As I imagine that such a class should be optimised away. There are a
few pairs like find/find_if with this kind of behaviour. While -O2 on
x86 optimises down to what you would expect, I didn't have time to
check others. Also as find is so small I wasn't sure it was worth the
effort of delegating it to find_if.