Ticket #7228 (closed Bugs: fixed)

Opened 5 years ago

Last modified 5 years ago

Bugs: #warning in lexical_cast.hpp causes MSVC compile error

Reported by: ldc@… Owned by: apolukhin
Milestone: Boost 1.52.0 Component: lexical_cast
Version: Boost 1.50.0 Severity: Cosmetic
Keywords: Cc: antoshkka@…


In lexical_cast.hpp # warning "Unable to use <locale> header. boost::lexical_cast will use the 'C' locale." is not portable and doesn't compile on MSVC. This is quite similar to

boost/chrono/config.hpp likely suffers from the same issue.


Change History

comment:1 Changed 5 years ago by apolukhin

  • Cc antoshkka@… added
  • Status changed from new to assigned
  • Severity changed from Regression to Cosmetic
  • Milestone changed from To Be Determined to Boost 1.52.0

This error can appear only if you are using invalid/lame version of STL library. As a fast workaround, you can define BOOST_LEXICAL_CAST_ASSUME_C_LOCALE.

I`ll add some documentation for this workaround via comments in lexical_cast.hpp header.

comment:2 Changed 5 years ago by apolukhin

(In [80409]) Merge from trunk: 1) #warning replaced with #error (refs #7228) 2) Pavel Korzh added to thanks list (refs #7157) 3) BOOST_NOEXCEPT modifiers added where possible 4) better support for c++11 Unicode characters 5) fixed compilation with MSVC+STLPort 6) more agressive usage of Traits template parameter 7) Added lexical_cast(const CharType?* chars, std::size_t count) function overload (refs #6430 and refs #6663) 8) Fixed GCC warning in numeric_cast_test.cpp 9) Fix compilation of lexical cast with MSVC 2003 (refs #7255)

comment:3 Changed 5 years ago by apolukhin

  • Status changed from assigned to closed
  • Resolution set to fixed

Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.