From f6dcb589f8fee8b6e4a66ab938481cfa360404fd Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 13 Dec 2007 00:30:46 +0000 Subject: [PATCH] Explicity use the classic locale in the case insensitive example. I could make the locale a member, but that would make the example longer. Also, this would be a good place to put a note about the need for constant function objects. [SVN r41995] --- doc/src_code/insensitive.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/src_code/insensitive.cpp b/doc/src_code/insensitive.cpp index 8cf29f1b..5e344177 100644 --- a/doc/src_code/insensitive.cpp +++ b/doc/src_code/insensitive.cpp @@ -14,7 +14,7 @@ bool operator()(std::string const& x, std::string const& y) const { - return boost::algorithm::iequals(x, y); + return boost::algorithm::iequals(x, y, std::locale()); } }; @@ -24,11 +24,12 @@ std::size_t operator()(std::string const& x) const { std::size_t seed = 0; + std::locale locale; for(std::string::const_iterator it = x.begin(); it != x.end(); ++it) { - boost::hash_combine(seed, std::toupper(*it)); + boost::hash_combine(seed, std::toupper(*it, locale)); } return seed;