Fixes #1847 Can't compile without <locale> header, boost::lexical_cast problem

[SVN r45201]
This commit is contained in:
Alexander Nasonov
2008-05-07 19:43:55 +00:00
parent e1dbc6ef04
commit ae5cbbbec8

View File

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