Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2007-12-12 19:30:46


Author: danieljames
Date: 2007-12-12 19:30:46 EST (Wed, 12 Dec 2007)
New Revision: 41995
URL: http://svn.boost.org/trac/boost/changeset/41995

Log:
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.

Text files modified:
   sandbox/unordered/libs/unordered/doc/src_code/insensitive.cpp | 5 +++--
   1 files changed, 3 insertions(+), 2 deletions(-)

Modified: sandbox/unordered/libs/unordered/doc/src_code/insensitive.cpp
==============================================================================
--- sandbox/unordered/libs/unordered/doc/src_code/insensitive.cpp (original)
+++ sandbox/unordered/libs/unordered/doc/src_code/insensitive.cpp 2007-12-12 19:30:46 EST (Wed, 12 Dec 2007)
@@ -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;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk