Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77936 - trunk/boost
From: antoshkka_at_[hidden]
Date: 2012-04-12 13:15:25


Author: apolukhin
Date: 2012-04-12 13:15:22 EDT (Thu, 12 Apr 2012)
New Revision: 77936
URL: http://svn.boost.org/trac/boost/changeset/77936

Log:
Fix compile time error in lexical_cast, when new unicode characters are being converted (Refs #6504 )
Text files modified:
   trunk/boost/lexical_cast.hpp | 14 ++++++++++++--
   1 files changed, 12 insertions(+), 2 deletions(-)

Modified: trunk/boost/lexical_cast.hpp
==============================================================================
--- trunk/boost/lexical_cast.hpp (original)
+++ trunk/boost/lexical_cast.hpp 2012-04-12 13:15:22 EDT (Thu, 12 Apr 2012)
@@ -1243,7 +1243,7 @@
             bool shl_char(T ch)
             {
                 BOOST_STATIC_ASSERT_MSG(( sizeof(T) <= sizeof(CharT)) ,
- "boost::lexical_cast does not support conversions from wchar_t to char types."
+ "boost::lexical_cast does not support conversions from wide character to char types."
                     "Use boost::locale instead" );
 #ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
                 std::locale loc;
@@ -1269,7 +1269,7 @@
             bool shl_char_array(T const* str)
             {
                 BOOST_STATIC_ASSERT_MSG(( sizeof(T) <= sizeof(CharT)),
- "boost::lexical_cast does not support conversions from wide character to char types."
+ "boost::lexical_cast does not support conversions from wide characters to char types."
                     "Use boost::locale instead" );
                 return shl_input_streamable(str);
             }
@@ -1457,6 +1457,16 @@
             bool operator<<(wchar_t ch) { return shl_char(ch); }
 #endif
 #endif
+#if !defined(BOOST_NO_CHAR16_T) && !defined(BOOST_NO_UNICODE_LITERALS)
+ bool operator<<(char16_t ch) { return shl_char(ch); }
+ bool operator<<(char16_t * str) { return shl_char_array(str); }
+ bool operator<<(char16_t const * str) { return shl_char_array(str); }
+#endif
+#if !defined(BOOST_NO_CHAR32_T) && !defined(BOOST_NO_UNICODE_LITERALS)
+ bool operator<<(char32_t ch) { return shl_char(ch); }
+ bool operator<<(char32_t * str) { return shl_char_array(str); }
+ bool operator<<(char32_t const * str) { return shl_char_array(str); }
+#endif
             bool operator<<(unsigned char const* ch) { return ((*this) << reinterpret_cast<char const*>(ch)); }
             bool operator<<(unsigned char * ch) { return ((*this) << reinterpret_cast<char *>(ch)); }
             bool operator<<(signed char const* ch) { return ((*this) << reinterpret_cast<char const*>(ch)); }


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