662a667,720 > namespace detail // lcast_ret_unsigned > { > template > inline bool lcast_ret_unsigned(T& value, const CharT* begin, const CharT* end) > { > #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS > BOOST_STATIC_ASSERT(!std::numeric_limits::is_signed); > #endif > > > #ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE > // TODO: use BOOST_NO_STD_LOCALE > std::locale loc; > typedef std::numpunct numpunct; > numpunct const& np = BOOST_USE_FACET(numpunct, loc); > std::string const& grouping = np.grouping(); > std::string::size_type const grouping_size = grouping.size(); > CharT thousands_sep = grouping_size ? np.thousands_sep() : 0; > #endif > > typedef typename Traits::int_type int_type; > CharT const czero = lcast_char_constants::zero; > int_type const zero = Traits::to_int_type(czero); > > value = 0; > > if ( *begin < czero || *begin > czero + 10) > return false; > value = *begin - zero; > ++ begin; > > while ( begin != end ) > { > #ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE > if ( Traits::eq(*begin, thousands_sep) ){ > ++ begin; > continue; > } > #endif > > if ( *begin < czero > || *begin > czero + 10 > || static_cast(value * 10) < value) > return false; > value *= 10; > value += *begin - zero; > ++begin; > }; > > return true; > } > > } > 760a819,894 > #define BOOST_DECLARE_INTERNAL_FAST_OUTPUT_OPERATORS_UNSIGNED(type) \ > bool operator>>(type& output) \ > { \ > CharT const minus = lcast_char_constants::minus; \ > if( Traits::eq(minus,*start) ) return false; \ > return lcast_ret_unsigned(output, start, finish); \ > } > > #define BOOST_DECLARE_INTERNAL_FAST_OUTPUT_OPERATORS_SIGNED(type) \ > bool operator>>(type& output) \ > { \ > CharT const minus = lcast_char_constants::minus; \ > unsigned type out_tmp =0; \ > bool const has_minus = Traits::eq(minus,*start); \ > if (has_minus) ++ start; \ > bool result = ( (*this)>>out_tmp ); \ > if (has_minus) -- start; \ > unsigned type const comp_val \ > = minus \ > ? static_cast(-(std::numeric_limits::min)()) \ > : static_cast((std::numeric_limits::max)()); \ > result = result && out_tmp<=comp_val; \ > output = has_minus ? -1 * out_tmp : out_tmp; \ > return result; \ > } > > BOOST_DECLARE_INTERNAL_FAST_OUTPUT_OPERATORS_UNSIGNED(unsigned short) > BOOST_DECLARE_INTERNAL_FAST_OUTPUT_OPERATORS_UNSIGNED(unsigned int) > BOOST_DECLARE_INTERNAL_FAST_OUTPUT_OPERATORS_UNSIGNED(unsigned long int) > #if defined(BOOST_HAS_LONG_LONG) > BOOST_DECLARE_INTERNAL_FAST_OUTPUT_OPERATORS_UNSIGNED( boost::ulong_long_type ) > #elif defined(BOOST_HAS_MS_INT64) > BOOST_DECLARE_INTERNAL_FAST_OUTPUT_OPERATORS_UNSIGNED(unsigned __int64) > #endif > > BOOST_DECLARE_INTERNAL_FAST_OUTPUT_OPERATORS_SIGNED(short) > BOOST_DECLARE_INTERNAL_FAST_OUTPUT_OPERATORS_SIGNED(int) > BOOST_DECLARE_INTERNAL_FAST_OUTPUT_OPERATORS_SIGNED(long int) > #if defined(BOOST_HAS_LONG_LONG) > bool operator>>(boost::long_long_type& output) > { > CharT const minus = lcast_char_constants::minus; > boost::ulong_long_type out_tmp =0; > bool const has_minus = Traits::eq(minus,*start); > if (has_minus) ++ start; > bool result = ( (*this)>>out_tmp ); > if (has_minus) -- start; > boost::ulong_long_type const comp_val > = minus > ? static_cast( > -(std::numeric_limits::min)() > ) > : static_cast( > (std::numeric_limits::max)() > ); > result = result && out_tmp<=comp_val; > output = has_minus ? -1 * out_tmp : out_tmp; > return result; > } > #elif defined(BOOST_HAS_MS_INT64) > BOOST_DECLARE_INTERNAL_FAST_OUTPUT_OPERATORS_SIGNED(__int64) > #endif > > #undef BOOST_DECLARE_INTERNAL_FAST_OUTPUT_OPERATORS_UNSIGNED > #undef BOOST_DECLARE_INTERNAL_FAST_OUTPUT_OPERATORS_SIGNED > > bool operator>>(bool& output) > { > output = (start[0] == lcast_char_constants::zero + 1); > return finish-start==1 > && ( > start[0] == lcast_char_constants::zero > || start[0] == lcast_char_constants::zero + 1 > ); > } > 1064a1199,1223 > > template<> > struct lcast_streambuf_for_target > { > BOOST_STATIC_CONSTANT(bool, value = false); > }; > > template<> > struct lcast_streambuf_for_target > { > BOOST_STATIC_CONSTANT(bool, value = false); > }; > > template<> > struct lcast_streambuf_for_target > { > BOOST_STATIC_CONSTANT(bool, value = false); > }; > > template<> > struct lcast_streambuf_for_target > { > BOOST_STATIC_CONSTANT(bool, value = false); > }; > 1071a1231,1259 > template<> > struct lcast_streambuf_for_target > { > BOOST_STATIC_CONSTANT(bool, value = false); > }; > > template<> > struct lcast_streambuf_for_target > { > BOOST_STATIC_CONSTANT(bool, value = false); > }; > > template<> > struct lcast_streambuf_for_target > { > BOOST_STATIC_CONSTANT(bool, value = false); > }; > > template<> > struct lcast_streambuf_for_target > { > BOOST_STATIC_CONSTANT(bool, value = false); > }; > > template<> > struct lcast_streambuf_for_target > { > BOOST_STATIC_CONSTANT(bool, value = false); > };