
"Max Motovilov"
Now, this:
struct less { bool operator()( const Object&, const Key& ) const; bool operator()( const Key&, const Object& ) const; };
lower_bound( v.begin(), v.end(), Key(something), less() );
should work everywhere, or so I think. Would be nice to be able to create such an adaptor for a pair of functions (or a pair of bind or lambda expressions for that matter). I blogged a simple solution (for functions only) here http://swsw.motovilov.net/weblogs/swsw/archives/2006/02/asymmetrical_pr.html but am wondering if perhaps I missed a generic solution in one of the Boost libraries, or there's one coming in the new release?
Well, standard libraries are now required to make it legal: http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#270 And you can get an implementation where it works at http://www.boost-consulting.com/vault/index.php?&direction=0&order=&directory=Algorithms/binary_search HTH, -- Dave Abrahams Boost Consulting www.boost-consulting.com