Added BOOST_LEXICAL_CAST_ASSUME_C_LOCALE.

[SVN r37950]
This commit is contained in:
Alexander Nasonov
2007-06-08 19:59:40 +00:00
parent da5151abf6
commit 9c1f3650f2

View File

@@ -459,21 +459,20 @@ namespace boost
template<typename T, typename CharT> template<typename T, typename CharT>
CharT* lcast_put_unsigned(T n, CharT* finish) CharT* lcast_put_unsigned(T n, CharT* finish)
{ {
typedef std::numpunct<CharT> numpunct;
CharT thousands_sep = 0; CharT thousands_sep = 0;
#if !defined(MEASURE_LEXICAL_CAST_PERFORMANCE_WITHOUT_LOCALE_OVERHEAD) #ifdef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
char const* grouping = "";
std::size_t const grouping_size = 0;
#else
std::locale loc; std::locale loc;
typedef std::numpunct<CharT> numpunct;
numpunct const& np = BOOST_USE_FACET(numpunct, loc); numpunct const& np = BOOST_USE_FACET(numpunct, loc);
std::string const& grouping = np.grouping(); std::string const& grouping = np.grouping();
std::string::size_type const grouping_size = grouping.size(); std::string::size_type const grouping_size = grouping.size();
if(grouping_size) if(grouping_size)
thousands_sep = np.thousands_sep(); thousands_sep = np.thousands_sep();
#else // dead branch in production code
char const* grouping = "";
std::size_t grouping_size = 0;
#endif #endif
std::string::size_type group = 0; // current group number std::string::size_type group = 0; // current group number