From: Pavol Droba (droba_at_[hidden])
Date: 2005-05-08 13:12:27
On Sat, May 07, 2005 at 08:18:42PM -0400, Joe Gottman wrote:
> I was looking at the string algorithms library, and I saw it had a
> case-insensitive equals function, iequals, as well as a predicate class,
> is_iequal. It would be nice if there were a case-insensitive less-than
> function and predicate as well. This would facilitate case-insensitive
> sorting, and set or maps which are sorted case-insensitively.
> Joe Gottman
I'm not sure if there is not a little bit of confusion here.
is_iequal provides character-base comparison that can be used in algorithms
like equals. Not vise-versa. So if I understand it correctly you would need
class the will encapsulate equals/iequals algorithm.
The same goes for less-then function you have proposed. Actualy, you can make
comparison using std::lexicographical_compare function, just you will
have to provide predicate class for maps and sets.
It might be reasonable to include range-base variant of lexicographical_compare
functions for convenience. But I think, that predicate classes should
be placed elsewhere, maybe closer to map/set implementation.
However, I might reconsider it laters.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk