Appendix A. Locales and Case-Insensitive String Comparisons
Item 35 explains how to use mismatch
and lexicographical_compare
to implement case-insensitive string comparisons, but it also points out that a truly general solution to the problem must take locales into account. This book is about the STL, not internationalization, so I have next to nothing to say about locales. However, Matt Austern, author of Generic Programming and the STL [4], addressed the locale aspects of case-insensitive string comparison in a column in the May 2000 C++ Report [11]. In the interest of telling the whole story on this important topic, I am pleased to reprint his column here, and I am grateful to Matt and to 101communications for granting me permission to do ...
Get Effective STL now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.