5 Mar
2006
5 Mar
'06
4:18 p.m.
Olaf van der Spek wrote:
Hi,
Does Boost contain a (string) compare function that returns -1 if a < b, 0 if a == b and 1 if a > b? Doing both < and == sounds like a lot of extra work in for example sorting algorithms.
std::string itself has a compare() member function that does this. You can use Boost.Bind to turn it into a function object. In addition, the string algorithm library has such functions in the development version, likely to be included in the next official release. Sebastian Redl