14,15c14,15 < // Alexander Nasonov and other Boosters < // when: November 2000, March 2003, June 2005, June 2006 --- > // Alexander Nasonov, Antony Polukhin and other Boosters > // when: November 2000, March 2003, June 2005, June 2006, March 2011 27a28,31 > #include > #include > #include > #include 1163a1168,1303 > > template > struct is_stdstring > { > BOOST_STATIC_CONSTANT(bool, value = false ); > }; > > template > struct is_stdstring< std::basic_string > > { > BOOST_STATIC_CONSTANT(bool, value = true ); > }; > > template > struct is_char_or_wchar > { > #ifndef BOOST_LCAST_NO_WCHAR_T > BOOST_STATIC_CONSTANT(bool, value = > ( > ::boost::type_traits::ice_or< > is_same< T, char >::value, > is_same< T, wchar_t >::value > >::value > ) > ); > #else > BOOST_STATIC_CONSTANT(bool, value = > (is_same< T, char >::value) > ); > #endif > > }; > > template > struct is_safe_arithmetic_to_arithmetic_impl > { > BOOST_STATIC_CONSTANT(bool, value = false); > }; > > template > struct is_safe_arithmetic_to_arithmetic_impl > { > BOOST_STATIC_CONSTANT(bool, value = > ( > ::boost::type_traits::ice_and< > ::boost::type_traits::ice_not< > boost::numeric::conversion_traits::subranged::value > >::value, > > ::boost::type_traits::ice_not< > is_char_or_wchar::value > >::value, > ::boost::type_traits::ice_not< > is_char_or_wchar::value > >::value > >::value > ) > ); > }; > > template > struct is_safe_arithmetic_to_arithmetic > { > BOOST_STATIC_CONSTANT(bool, value = > ( > is_safe_arithmetic_to_arithmetic_impl< > ::boost::type_traits::ice_and< > is_arithmetic::value, > is_arithmetic::value > >::value, > Target, > Source > >::value > ) > ); > }; > > template > struct is_xchar_to_xchar > { > BOOST_STATIC_CONSTANT(bool, value = > ( > ::boost::type_traits::ice_and< > is_same::value, > is_char_or_wchar::value > >::value > ) > ); > }; > > template > struct is_char_array_to_stdstring > { > BOOST_STATIC_CONSTANT(bool, value = false ); > }; > > template > struct is_char_array_to_stdstring< std::basic_string, CharT* > > { > BOOST_STATIC_CONSTANT(bool, value = true ); > }; > > template > struct is_char_array_to_stdstring< std::basic_string, const CharT* > > { > BOOST_STATIC_CONSTANT(bool, value = true ); > }; > > template > struct lexical_cast_do_cast > { > static inline Target lexical_cast_impl(const Source &arg) > { > typedef typename detail::array_to_pointer_decay::type src; > > typedef typename detail::widest_char< > typename detail::stream_char::type > , typename detail::stream_char::type > >::type char_type; > > typedef detail::lcast_src_length lcast_src_length; > std::size_t const src_len = lcast_src_length::value; > char_type buf[src_len + 1]; > lcast_src_length::check_coverage(); > return detail::lexical_cast(arg, buf, src_len); > } > }; > > template > struct lexical_cast_copy > { > static inline Source lexical_cast_impl(const Source &arg) > { > return arg; > } > }; 1169c1309,1325 < typedef typename detail::array_to_pointer_decay::type src; --- > typedef BOOST_DEDUCED_TYPENAME detail::array_to_pointer_decay::type src; > > typedef BOOST_DEDUCED_TYPENAME ::boost::type_traits::ice_or< > detail::is_safe_arithmetic_to_arithmetic::value, > detail::is_xchar_to_xchar::value, > detail::is_char_array_to_stdstring::value, > ::boost::type_traits::ice_and< > is_same::value, > detail::is_stdstring::value > >::value > > do_copy_type; > > typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_c< > do_copy_type::value, > detail::lexical_cast_copy, > detail::lexical_cast_do_cast > >::type caster_type; 1171,1180c1327 < typedef typename detail::widest_char< < typename detail::stream_char::type < , typename detail::stream_char::type < >::type char_type; < < typedef detail::lcast_src_length lcast_src_length; < std::size_t const src_len = lcast_src_length::value; < char_type buf[src_len + 1]; < lcast_src_length::check_coverage(); < return detail::lexical_cast(arg, buf, src_len); --- > return caster_type::lexical_cast_impl(arg);