Boost logo

Boost-Commit :

From: Alexander.Nasonov_at_[hidden]
Date: 2008-05-07 15:43:56


Author: nasonov
Date: 2008-05-07 15:43:55 EDT (Wed, 07 May 2008)
New Revision: 45201
URL: http://svn.boost.org/trac/boost/changeset/45201

Log:
Fixes #1847 Can't compile without <locale> header, boost::lexical_cast problem
Text files modified:
   trunk/boost/lexical_cast.hpp | 7 ++++++-
   1 files changed, 6 insertions(+), 1 deletions(-)

Modified: trunk/boost/lexical_cast.hpp
==============================================================================
--- trunk/boost/lexical_cast.hpp (original)
+++ trunk/boost/lexical_cast.hpp 2008-05-07 15:43:55 EDT (Wed, 07 May 2008)
@@ -17,7 +17,6 @@
 #include <climits>
 #include <cstddef>
 #include <istream>
-#include <locale>
 #include <string>
 #include <typeinfo>
 #include <boost/config.hpp>
@@ -30,6 +29,10 @@
 #include <boost/static_assert.hpp>
 #include <boost/detail/lcast_precision.hpp>
 
+#ifndef BOOST_NO_STD_LOCALE
+#include <locale>
+#endif
+
 #ifdef BOOST_NO_STRINGSTREAM
 #include <strstream>
 #else
@@ -485,6 +488,7 @@
 #endif
 
 #ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
+ // TODO: use BOOST_NO_STD_LOCALE
             std::locale loc;
             typedef std::numpunct<CharT> numpunct;
             numpunct const& np = BOOST_USE_FACET(numpunct, loc);
@@ -651,6 +655,7 @@
 #ifndef DISABLE_WIDE_CHAR_SUPPORT
             static void widen_and_assign(wchar_t* p, char ch)
             {
+ // TODO: use BOOST_NO_STD_LOCALE
                 std::locale loc;
                 wchar_t w = BOOST_USE_FACET(std::ctype<wchar_t>, loc).widen(ch);
                 Traits::assign(*p, w);


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