Boost logo

Boost :

From: Matt Austern (austern_at_[hidden])
Date: 2002-01-30 12:07:28

John Maddock wrote:

>>Using locales, you can lexicographically compare strings. However, in
> this
>>context, you need to compare strings while ignoring case, and I don't
> recall
>>that being part of the locale framework.
> You can do case conversion using the std::ctype facet, but there is no
> caseless string compare facility as such.

Besides, case-insensitive string comparison raises two more questions.
First, which locale do you do it in? The program's global locale is
surely the wrong answer. Second, std::ctype's mechanism for case
conversion isn't quite right. It assumes you can do case conversion one
letter at a time and it assumes that the uppercase version of a string
always has the same number of characters as the lowercase version. Both
assumptions are wrong.


Boost list run by bdawes at, gregod at, cpdaniel at, john at