Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85475 - in trunk: boost libs/conversion/test
From: antoshkka_at_[hidden]
Date: 2013-08-26 07:18:42


Author: apolukhin
Date: 2013-08-26 07:18:42 EDT (Mon, 26 Aug 2013)
New Revision: 85475
URL: http://svn.boost.org/trac/boost/changeset/85475

Log:
Get rid of some macro, improve type traits, fix svn properties, do not supress warnings (refs #9046)

Properties modified:
   trunk/libs/conversion/test/lexical_cast_empty_input_test.cpp (props changed)
   trunk/libs/conversion/test/lexical_cast_float_types_test.cpp (props changed)
   trunk/libs/conversion/test/lexical_cast_inf_nan_test.cpp (props changed)
   trunk/libs/conversion/test/lexical_cast_no_exceptions_test.cpp (props changed)
   trunk/libs/conversion/test/lexical_cast_no_locale_test.cpp (props changed)
   trunk/libs/conversion/test/lexical_cast_pointers_test.cpp (props changed)
   trunk/libs/conversion/test/lexical_cast_typedefed_wchar_test.cpp (props changed)
   trunk/libs/conversion/test/lexical_cast_typedefed_wchar_test_runtime.cpp (props changed)
   trunk/libs/conversion/test/lexical_cast_wchars_test.cpp (contents, props changed)
Text files modified:
   trunk/boost/lexical_cast.hpp | 361 ++++++++++-----------------------------
   trunk/libs/conversion/test/lexical_cast_stream_traits_test.cpp | 2
   trunk/libs/conversion/test/lexical_cast_wchars_test.cpp | 51 +++++
   3 files changed, 147 insertions(+), 267 deletions(-)

Modified: trunk/boost/lexical_cast.hpp
==============================================================================
--- trunk/boost/lexical_cast.hpp Mon Aug 26 06:43:14 2013 (r85474)
+++ trunk/boost/lexical_cast.hpp 2013-08-26 07:18:42 EDT (Mon, 26 Aug 2013) (r85475)
@@ -87,50 +87,39 @@
 
     {
     public:
- bad_lexical_cast() BOOST_NOEXCEPT :
+ bad_lexical_cast() BOOST_NOEXCEPT
 #ifndef BOOST_NO_TYPEID
- source(&typeid(void)), target(&typeid(void))
-#else
- source(0), target(0) // this breaks getters
+ : source(&typeid(void)), target(&typeid(void))
 #endif
- {
+ {}
+
+ virtual const char *what() const BOOST_NOEXCEPT_OR_NOTHROW {
+ return "bad lexical cast: "
+ "source type value could not be interpreted as target";
         }
 
+ virtual ~bad_lexical_cast() BOOST_NOEXCEPT_OR_NOTHROW
+ {}
+
+#ifndef BOOST_NO_TYPEID
         bad_lexical_cast(
- const std::type_info &source_type_arg,
- const std::type_info &target_type_arg) BOOST_NOEXCEPT :
- source(&source_type_arg), target(&target_type_arg)
- {
- }
+ const std::type_info &source_type_arg,
+ const std::type_info &target_type_arg) BOOST_NOEXCEPT
+ : source(&source_type_arg), target(&target_type_arg)
+ {}
 
- const std::type_info &source_type() const
- {
+ const std::type_info &source_type() const BOOST_NOEXCEPT {
             return *source;
         }
- const std::type_info &target_type() const
- {
- return *target;
- }
 
-#ifndef BOOST_NO_CXX11_NOEXCEPT
- virtual const char *what() const noexcept
-#else
- virtual const char *what() const throw()
-#endif
- {
- return "bad lexical cast: "
- "source type value could not be interpreted as target";
+ const std::type_info &target_type() const BOOST_NOEXCEPT {
+ return *target;
         }
 
-#ifndef BOOST_NO_CXX11_NOEXCEPT
- virtual ~bad_lexical_cast() BOOST_NOEXCEPT
-#else
- virtual ~bad_lexical_cast() throw()
-#endif
- {}
     private:
         const std::type_info *source;
         const std::type_info *target;
+#endif
     };
 
     namespace detail // widest_char
@@ -175,11 +164,11 @@
 
 namespace boost {
 
- namespace detail // is_char_or_wchar<...>
+ namespace detail // is_character<...>
     {
         // returns true, if T is one of the character types
         template < typename T >
- struct is_char_or_wchar
+ struct is_character
         {
             typedef boost::type_traits::ice_or<
                     boost::is_same< T, char >::value,
@@ -236,35 +225,35 @@
         // Executed on Stage 1 (See deduce_source_char<T> and deduce_target_char<T>)
         template < typename Type >
         struct stream_char_common: public boost::mpl::if_c<
- boost::detail::is_char_or_wchar< Type >::value,
+ boost::detail::is_character< Type >::value,
             Type,
             boost::detail::deduce_character_type_later< Type >
> {};
 
         template < typename Char >
         struct stream_char_common< Char* >: public boost::mpl::if_c<
- boost::detail::is_char_or_wchar< Char >::value,
+ boost::detail::is_character< Char >::value,
             Char,
             boost::detail::deduce_character_type_later< Char* >
> {};
 
         template < typename Char >
         struct stream_char_common< const Char* >: public boost::mpl::if_c<
- boost::detail::is_char_or_wchar< Char >::value,
+ boost::detail::is_character< Char >::value,
             Char,
             boost::detail::deduce_character_type_later< const Char* >
> {};
 
         template < typename Char >
         struct stream_char_common< boost::iterator_range< Char* > >: public boost::mpl::if_c<
- boost::detail::is_char_or_wchar< Char >::value,
+ boost::detail::is_character< Char >::value,
             Char,
             boost::detail::deduce_character_type_later< boost::iterator_range< Char* > >
> {};
     
         template < typename Char >
         struct stream_char_common< boost::iterator_range< const Char* > >: public boost::mpl::if_c<
- boost::detail::is_char_or_wchar< Char >::value,
+ boost::detail::is_character< Char >::value,
             Char,
             boost::detail::deduce_character_type_later< boost::iterator_range< const Char* > >
> {};
@@ -283,14 +272,14 @@
 
         template < typename Char, std::size_t N >
         struct stream_char_common< boost::array< Char, N > >: public boost::mpl::if_c<
- boost::detail::is_char_or_wchar< Char >::value,
+ boost::detail::is_character< Char >::value,
             Char,
             boost::detail::deduce_character_type_later< boost::array< Char, N > >
> {};
 
         template < typename Char, std::size_t N >
         struct stream_char_common< boost::array< const Char, N > >: public boost::mpl::if_c<
- boost::detail::is_char_or_wchar< Char >::value,
+ boost::detail::is_character< Char >::value,
             Char,
             boost::detail::deduce_character_type_later< boost::array< const Char, N > >
> {};
@@ -298,14 +287,14 @@
 #ifndef BOOST_NO_CXX11_HDR_ARRAY
         template < typename Char, std::size_t N >
         struct stream_char_common< std::array<Char, N > >: public boost::mpl::if_c<
- boost::detail::is_char_or_wchar< Char >::value,
+ boost::detail::is_character< Char >::value,
             Char,
             boost::detail::deduce_character_type_later< std::array< Char, N > >
> {};
 
         template < typename Char, std::size_t N >
         struct stream_char_common< std::array< const Char, N > >: public boost::mpl::if_c<
- boost::detail::is_char_or_wchar< Char >::value,
+ boost::detail::is_character< Char >::value,
             Char,
             boost::detail::deduce_character_type_later< std::array< const Char, N > >
> {};
@@ -427,86 +416,29 @@
         };
     }
 
- namespace detail // deduce_char_traits template
+ namespace detail // extract_char_traits template
     {
- // We are attempting to get char_traits<> from Source or Tagret
+ // We are attempting to get char_traits<> from T
         // template parameter. Otherwise we'll be using std::char_traits<Char>
- template < class Char, class Target, class Source >
- struct deduce_char_traits
- {
- typedef std::char_traits< Char > type;
- };
-
- template < class Char, class Traits, class Alloc, class Source >
- struct deduce_char_traits< Char
- , std::basic_string< Char, Traits, Alloc >
- , Source
- >
+ template < class Char, class T >
+ struct extract_char_traits
+ : boost::false_type
         {
- typedef Traits type;
+ typedef std::char_traits< Char > trait_t;
         };
 
- template < class Char, class Target, class Traits, class Alloc >
- struct deduce_char_traits< Char
- , Target
- , std::basic_string< Char, Traits, Alloc >
- >
- {
- typedef Traits type;
- };
-
- template < class Char, class Traits, class Alloc, class Source >
- struct deduce_char_traits< Char
- , boost::container::basic_string< Char, Traits, Alloc >
- , Source
- >
- {
- typedef Traits type;
- };
-
- template < class Char, class Target, class Traits, class Alloc >
- struct deduce_char_traits< Char
- , Target
- , boost::container::basic_string< Char, Traits, Alloc >
- >
- {
- typedef Traits type;
- };
-
- template < class Char, class Traits, class Alloc1, class Alloc2 >
- struct deduce_char_traits< Char
- , std::basic_string< Char, Traits, Alloc1 >
- , std::basic_string< Char, Traits, Alloc2 >
- >
- {
- typedef Traits type;
- };
-
- template<class Char, class Traits, class Alloc1, class Alloc2>
- struct deduce_char_traits< Char
- , boost::container::basic_string< Char, Traits, Alloc1 >
- , boost::container::basic_string< Char, Traits, Alloc2 >
- >
- {
- typedef Traits type;
- };
-
- template < class Char, class Traits, class Alloc1, class Alloc2 >
- struct deduce_char_traits< Char
- , boost::container::basic_string< Char, Traits, Alloc1 >
- , std::basic_string< Char, Traits, Alloc2 >
- >
+ template < class Char, class Traits, class Alloc >
+ struct extract_char_traits< Char, std::basic_string< Char, Traits, Alloc > >
+ : boost::true_type
         {
- typedef Traits type;
+ typedef Traits trait_t;
         };
 
- template < class Char, class Traits, class Alloc1, class Alloc2 >
- struct deduce_char_traits< Char
- , std::basic_string< Char, Traits, Alloc1 >
- , boost::container::basic_string< Char, Traits, Alloc2 >
- >
+ template < class Char, class Traits, class Alloc>
+ struct extract_char_traits< Char, boost::container::basic_string< Char, Traits, Alloc > >
+ : boost::true_type
         {
- typedef Traits type;
+ typedef Traits trait_t;
         };
     }
 
@@ -552,7 +484,8 @@
     namespace detail // lcast_src_length
     {
         // Return max. length of string representation of Source;
- template< class Source // Source type of lexical_cast.
+ template< class Source, // Source type of lexical_cast.
+ class Enable = void // helper type
>
         struct lcast_src_length
         {
@@ -575,8 +508,10 @@
         // <boost/limits.hpp> doesn't add missing specialization for
         // numeric_limits<T> for some integral type T.
         // When is_specialized is false, the whole expression is 0.
- template<class Source>
- struct lcast_src_length_integral
+ template <class Source>
+ struct lcast_src_length<
+ Source, BOOST_DEDUCED_TYPENAME boost::enable_if<boost::is_integral<Source> >::type
+ >
         {
 #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
             BOOST_STATIC_CONSTANT(std::size_t, value =
@@ -588,33 +523,9 @@
             BOOST_STATIC_CONSTANT(std::size_t, value = 156);
             BOOST_STATIC_ASSERT(sizeof(Source) * CHAR_BIT <= 256);
 #endif
+ static void check_coverage() {}
         };
 
-#define BOOST_LCAST_DEF(T) \
- template<> struct lcast_src_length<T> \
- : lcast_src_length_integral<T> \
- { static void check_coverage() {} };
-
- BOOST_LCAST_DEF(short)
- BOOST_LCAST_DEF(unsigned short)
- BOOST_LCAST_DEF(int)
- BOOST_LCAST_DEF(unsigned int)
- BOOST_LCAST_DEF(long)
- BOOST_LCAST_DEF(unsigned long)
-#if defined(BOOST_HAS_LONG_LONG)
- BOOST_LCAST_DEF(boost::ulong_long_type)
- BOOST_LCAST_DEF(boost::long_long_type )
-#elif defined(BOOST_HAS_MS_INT64)
- BOOST_LCAST_DEF(unsigned __int64)
- BOOST_LCAST_DEF( __int64)
-#endif
-#ifdef BOOST_HAS_INT128
- BOOST_LCAST_DEF(boost::int128_type)
- BOOST_LCAST_DEF(boost::uint128_type)
-#endif
-
-#undef BOOST_LCAST_DEF
-
 #ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
         // Helper for floating point types.
         // -1.23456789e-123456
@@ -627,38 +538,21 @@
         // ^^^^^^ exponent (assumed 6 or less digits)
         // sign + leading digit + decimal point + "e" + exponent sign == 5
         template<class Source>
- struct lcast_src_length_floating
+ struct lcast_src_length<
+ Source, BOOST_DEDUCED_TYPENAME boost::enable_if<boost::is_float<Source> >::type
+ >
         {
             BOOST_STATIC_ASSERT(
                     std::numeric_limits<Source>::max_exponent10 <= 999999L &&
                     std::numeric_limits<Source>::min_exponent10 >= -999999L
                 );
+
             BOOST_STATIC_CONSTANT(std::size_t, value =
                     5 + lcast_precision<Source>::value + 6
                 );
- };
 
- template<>
- struct lcast_src_length<float>
- : lcast_src_length_floating<float>
- {
- static void check_coverage() {}
- };
-
- template<>
- struct lcast_src_length<double>
- : lcast_src_length_floating<double>
- {
             static void check_coverage() {}
         };
-
- template<>
- struct lcast_src_length<long double>
- : lcast_src_length_floating<long double>
- {
- static void check_coverage() {}
- };
-
 #endif // #ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
     }
 
@@ -688,22 +582,24 @@
                 "Your compiler does not have full support for char32_t" );
 #endif
 
- typedef BOOST_DEDUCED_TYPENAME boost::detail::deduce_char_traits<
- char_type, Target, no_cv_src
+ typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_c<
+ boost::detail::extract_char_traits<char_type, Target>::value,
+ BOOST_DEDUCED_TYPENAME boost::detail::extract_char_traits<char_type, Target>::trait_t,
+ BOOST_DEDUCED_TYPENAME boost::detail::extract_char_traits<char_type, no_cv_src>::trait_t
>::type traits;
 
             typedef boost::type_traits::ice_and<
                 boost::is_same<char, src_char_t>::value, // source is not a wide character based type
                 boost::type_traits::ice_ne<sizeof(char), sizeof(target_char_t) >::value, // target type is based on wide character
                 boost::type_traits::ice_not<
- boost::detail::is_char_or_wchar<no_cv_src>::value // single character widening is optimized
+ boost::detail::is_character<no_cv_src>::value // single character widening is optimized
>::value // and does not requires stringbuffer
> is_string_widening_required_t;
 
             typedef boost::type_traits::ice_not< boost::type_traits::ice_or<
                 boost::is_integral<no_cv_src>::value,
                 boost::detail::is_this_float_conversion_optimized<no_cv_src, char_type >::value,
- boost::detail::is_char_or_wchar<
+ boost::detail::is_character<
                     BOOST_DEDUCED_TYPENAME deduce_src_char_metafunc::stage1_type // if we did not get character type at stage1
>::value // then we have no optimization for that type
>::value > is_source_input_not_optimized_t;
@@ -720,59 +616,19 @@
         };
     }
 
- namespace detail // '0', '+' and '-' constants
+ namespace detail // '0', '-', '+', 'e', 'E' and '.' constants
     {
- template < typename Char > struct lcast_char_constants;
-
- template<>
- struct lcast_char_constants<char>
- {
- BOOST_STATIC_CONSTANT(char, zero = '0');
- BOOST_STATIC_CONSTANT(char, minus = '-');
- BOOST_STATIC_CONSTANT(char, plus = '+');
- BOOST_STATIC_CONSTANT(char, lowercase_e = 'e');
- BOOST_STATIC_CONSTANT(char, capital_e = 'E');
- BOOST_STATIC_CONSTANT(char, c_decimal_separator = '.');
- };
-
-#ifndef BOOST_LCAST_NO_WCHAR_T
- template<>
- struct lcast_char_constants<wchar_t>
- {
- BOOST_STATIC_CONSTANT(wchar_t, zero = L'0');
- BOOST_STATIC_CONSTANT(wchar_t, minus = L'-');
- BOOST_STATIC_CONSTANT(wchar_t, plus = L'+');
- BOOST_STATIC_CONSTANT(wchar_t, lowercase_e = L'e');
- BOOST_STATIC_CONSTANT(wchar_t, capital_e = L'E');
- BOOST_STATIC_CONSTANT(wchar_t, c_decimal_separator = L'.');
- };
-#endif
-
-#if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS)
- template<>
- struct lcast_char_constants<char16_t>
- {
- BOOST_STATIC_CONSTANT(char16_t, zero = u'0');
- BOOST_STATIC_CONSTANT(char16_t, minus = u'-');
- BOOST_STATIC_CONSTANT(char16_t, plus = u'+');
- BOOST_STATIC_CONSTANT(char16_t, lowercase_e = u'e');
- BOOST_STATIC_CONSTANT(char16_t, capital_e = u'E');
- BOOST_STATIC_CONSTANT(char16_t, c_decimal_separator = u'.');
- };
-#endif
-
-#if !defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS)
- template<>
- struct lcast_char_constants<char32_t>
- {
- BOOST_STATIC_CONSTANT(char32_t, zero = U'0');
- BOOST_STATIC_CONSTANT(char32_t, minus = U'-');
- BOOST_STATIC_CONSTANT(char32_t, plus = U'+');
- BOOST_STATIC_CONSTANT(char32_t, lowercase_e = U'e');
- BOOST_STATIC_CONSTANT(char32_t, capital_e = U'E');
- BOOST_STATIC_CONSTANT(char32_t, c_decimal_separator = U'.');
+ template < typename Char >
+ struct lcast_char_constants {
+ // We check in tests assumption that static casted character is
+ // equal to correctly written C++ literal: U'0' == static_cast<char32_t>('0')
+ BOOST_STATIC_CONSTANT(Char, zero = static_cast<Char>('0'));
+ BOOST_STATIC_CONSTANT(Char, minus = static_cast<Char>('-'));
+ BOOST_STATIC_CONSTANT(Char, plus = static_cast<Char>('+'));
+ BOOST_STATIC_CONSTANT(Char, lowercase_e = static_cast<Char>('e'));
+ BOOST_STATIC_CONSTANT(Char, capital_e = static_cast<Char>('E'));
+ BOOST_STATIC_CONSTANT(Char, c_decimal_separator = static_cast<Char>('.'));
         };
-#endif
     }
 
     namespace detail // lcast_to_unsigned
@@ -2013,17 +1869,7 @@
                 stream.unsetf(std::ios::skipws);
                 lcast_set_precision(stream, static_cast<InputStreamable*>(0));
 
- return stream >> output &&
- stream.get() ==
-#if defined(__GNUC__) && (__GNUC__<3) && defined(BOOST_NO_STD_WSTRING)
- // GCC 2.9x lacks std::char_traits<>::eof().
- // We use BOOST_NO_STD_WSTRING to filter out STLport and libstdc++-v3
- // configurations, which do provide std::char_traits<>::eof().
-
- EOF;
-#else
- Traits::eof();
-#endif
+ return stream >> output && stream.get() == Traits::eof();
 
 #ifndef BOOST_NO_EXCEPTIONS
                 } catch (const ::std::ios_base::failure& /*f*/) {
@@ -2252,21 +2098,18 @@
     {
         template<typename T>
         struct is_stdstring
- {
- BOOST_STATIC_CONSTANT(bool, value = false );
- };
+ : boost::false_type
+ {};
 
         template<typename CharT, typename Traits, typename Alloc>
         struct is_stdstring< std::basic_string<CharT, Traits, Alloc> >
- {
- BOOST_STATIC_CONSTANT(bool, value = true );
- };
+ : boost::true_type
+ {};
 
         template<typename CharT, typename Traits, typename Alloc>
         struct is_stdstring< boost::container::basic_string<CharT, Traits, Alloc> >
- {
- BOOST_STATIC_CONSTANT(bool, value = true );
- };
+ : boost::true_type
+ {};
 
         template<typename Target, typename Source>
         struct is_arithmetic_and_not_xchars
@@ -2277,10 +2120,10 @@
                            boost::is_arithmetic<Source>::value,
                            boost::is_arithmetic<Target>::value,
                            boost::type_traits::ice_not<
- detail::is_char_or_wchar<Target>::value
+ boost::detail::is_character<Target>::value
>::value,
                            boost::type_traits::ice_not<
- detail::is_char_or_wchar<Source>::value
+ boost::detail::is_character<Source>::value
>::value
>::value
                )
@@ -2299,14 +2142,14 @@
                 (
                     boost::type_traits::ice_or<
                         boost::type_traits::ice_and<
- is_same<Source,Target>::value,
- is_char_or_wchar<Target>::value
+ boost::is_same<Source,Target>::value,
+ boost::detail::is_character<Target>::value
>::value,
                         boost::type_traits::ice_and<
                              boost::type_traits::ice_eq< sizeof(char),sizeof(Target)>::value,
                              boost::type_traits::ice_eq< sizeof(char),sizeof(Source)>::value,
- is_char_or_wchar<Target>::value,
- is_char_or_wchar<Source>::value
+ boost::detail::is_character<Target>::value,
+ boost::detail::is_character<Source>::value
>::value
>::value
                 )
@@ -2315,40 +2158,29 @@
 
         template<typename Target, typename Source>
         struct is_char_array_to_stdstring
- {
- BOOST_STATIC_CONSTANT(bool, value = false );
- };
+ : boost::false_type
+ {};
 
         template<typename CharT, typename Traits, typename Alloc>
         struct is_char_array_to_stdstring< std::basic_string<CharT, Traits, Alloc>, CharT* >
- {
- BOOST_STATIC_CONSTANT(bool, value = true );
- };
+ : boost::true_type
+ {};
 
         template<typename CharT, typename Traits, typename Alloc>
         struct is_char_array_to_stdstring< std::basic_string<CharT, Traits, Alloc>, const CharT* >
- {
- BOOST_STATIC_CONSTANT(bool, value = true );
- };
+ : boost::true_type
+ {};
 
         template<typename CharT, typename Traits, typename Alloc>
         struct is_char_array_to_stdstring< boost::container::basic_string<CharT, Traits, Alloc>, CharT* >
- {
- BOOST_STATIC_CONSTANT(bool, value = true );
- };
+ : boost::true_type
+ {};
 
         template<typename CharT, typename Traits, typename Alloc>
         struct is_char_array_to_stdstring< boost::container::basic_string<CharT, Traits, Alloc>, const CharT* >
- {
- BOOST_STATIC_CONSTANT(bool, value = true );
- };
+ : boost::true_type
+ {};
 
-#if (defined _MSC_VER)
-# pragma warning( push )
-# pragma warning( disable : 4701 ) // possible use of ... before initialization
-# pragma warning( disable : 4702 ) // unreachable code
-# pragma warning( disable : 4267 ) // conversion from 'size_t' to 'unsigned int'
-#endif
         template<typename Target, typename Source>
         struct lexical_cast_do_cast
         {
@@ -2377,9 +2209,6 @@
                 return result;
             }
         };
-#if (defined _MSC_VER)
-# pragma warning( pop )
-#endif
 
         template <typename Source>
         struct lexical_cast_copy

Modified: trunk/libs/conversion/test/lexical_cast_stream_traits_test.cpp
==============================================================================
--- trunk/libs/conversion/test/lexical_cast_stream_traits_test.cpp Mon Aug 26 06:43:14 2013 (r85474)
+++ trunk/libs/conversion/test/lexical_cast_stream_traits_test.cpp 2013-08-26 07:18:42 EDT (Mon, 26 Aug 2013) (r85475)
@@ -40,7 +40,7 @@
     BOOST_CHECK((boost::is_same<BOOST_DEDUCED_TYPENAME trait_3::target_char_t, wchar_t>::value));
     BOOST_CHECK((boost::is_same<BOOST_DEDUCED_TYPENAME trait_3::char_type, wchar_t>::value));
 
- BOOST_CHECK((boost::detail::is_char_or_wchar<BOOST_DEDUCED_TYPENAME trait_3::no_cv_src>::value != trait_3::is_string_widening_required_t::value));
+ BOOST_CHECK((boost::detail::is_character<BOOST_DEDUCED_TYPENAME trait_3::no_cv_src>::value != trait_3::is_string_widening_required_t::value));
 
     BOOST_CHECK(!trait_3::is_source_input_not_optimized_t::value);
 }

Modified: trunk/libs/conversion/test/lexical_cast_wchars_test.cpp
==============================================================================
--- trunk/libs/conversion/test/lexical_cast_wchars_test.cpp Mon Aug 26 06:43:14 2013 (r85474)
+++ trunk/libs/conversion/test/lexical_cast_wchars_test.cpp 2013-08-26 07:18:42 EDT (Mon, 26 Aug 2013) (r85475)
@@ -51,6 +51,23 @@
 {
 #ifndef BOOST_LCAST_NO_WCHAR_T
     test_impl(L"Test array of chars");
+ wchar_t c = boost::detail::lcast_char_constants<wchar_t>::zero;
+ BOOST_CHECK_EQUAL(L'0', c);
+
+ c = boost::detail::lcast_char_constants<wchar_t>::minus;
+ BOOST_CHECK_EQUAL(L'-', c);
+
+ c = boost::detail::lcast_char_constants<wchar_t>::plus;
+ BOOST_CHECK_EQUAL(L'+', c);
+
+ c = boost::detail::lcast_char_constants<wchar_t>::lowercase_e;
+ BOOST_CHECK_EQUAL(L'e', c);
+
+ c = boost::detail::lcast_char_constants<wchar_t>::capital_e;
+ BOOST_CHECK_EQUAL(L'E', c);
+
+ c = boost::detail::lcast_char_constants<wchar_t>::c_decimal_separator;
+ BOOST_CHECK_EQUAL(L'.', c);
 #endif
 
     BOOST_CHECK(true);
@@ -60,6 +77,23 @@
 {
 #if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) && defined(BOOST_STL_SUPPORTS_NEW_UNICODE_LOCALES)
     test_impl(u"Test array of chars");
+ char16_t c = boost::detail::lcast_char_constants<char16_t>::zero;
+ BOOST_CHECK_EQUAL(u'0', c);
+
+ c = boost::detail::lcast_char_constants<char16_t>::minus;
+ BOOST_CHECK_EQUAL(u'-', c);
+
+ c = boost::detail::lcast_char_constants<char16_t>::plus;
+ BOOST_CHECK_EQUAL(u'+', c);
+
+ c = boost::detail::lcast_char_constants<char16_t>::lowercase_e;
+ BOOST_CHECK_EQUAL(u'e', c);
+
+ c = boost::detail::lcast_char_constants<char16_t>::capital_e;
+ BOOST_CHECK_EQUAL(u'E', c);
+
+ c = boost::detail::lcast_char_constants<char16_t>::c_decimal_separator;
+ BOOST_CHECK_EQUAL(u'.', c);
 #endif
 
     BOOST_CHECK(true);
@@ -69,6 +103,23 @@
 {
 #if !defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) && defined(BOOST_STL_SUPPORTS_NEW_UNICODE_LOCALES)
     test_impl(U"Test array of chars");
+ char32_t c = boost::detail::lcast_char_constants<char32_t>::zero;
+ BOOST_CHECK_EQUAL(U'0', c);
+
+ c = boost::detail::lcast_char_constants<char32_t>::minus;
+ BOOST_CHECK_EQUAL(U'-', c);
+
+ c = boost::detail::lcast_char_constants<char32_t>::plus;
+ BOOST_CHECK_EQUAL(U'+', c);
+
+ c = boost::detail::lcast_char_constants<char32_t>::lowercase_e;
+ BOOST_CHECK_EQUAL(U'e', c);
+
+ c = boost::detail::lcast_char_constants<char32_t>::capital_e;
+ BOOST_CHECK_EQUAL(U'E', c);
+
+ c = boost::detail::lcast_char_constants<char32_t>::c_decimal_separator;
+ BOOST_CHECK_EQUAL(U'.', c);
 #endif
 
     BOOST_CHECK(true);


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