38template<
typename T,
typename Storage_Type >
40typename std::enable_if< std::is_signed<T>::value,
bool >::type
47template<
typename T,
typename Storage_Type >
49typename std::enable_if< !std::is_signed<T>::value,
bool >::type
58template<
typename T,
typename Ext >
67 std::numeric_limits<T>::max() );
73 static_assert( std::is_signed<T>::value,
74 "extremum_value<T, check_negative_extremum> is defined only "
75 "for signed numeric types" );
80 std::numeric_limits<T>::min() );
84 "The integer representation is expected to be two's complement" );
168 is_greater_than_maximum<T>( updated_value, extremum_value::value ) )
Helper class for accumulating integer value during parsing it from string (with check for overflow).
storage_type m_current
The current value of the accumulator.
void next_digit(T digit) noexcept
Try to add another digit to the accumulator.
typename extremum_value::storage_type storage_type
Type to be used for holding intermediate value.
T value() const noexcept
Get the current accumulator value.
bool overflow_detected() const noexcept
Is overflow detected during previous call to next_digit?
bool m_overflow_detected
Overflow detection flag.
overflow_controlled_integer_accumulator_details::extremum_value< T, Extremum_Type > extremum_value
Detection of compiler version and absence of various features.
std::enable_if< std::is_signed< T >::value, bool >::type is_greater_than_maximum(Storage_Type v, Storage_Type maximum)
std::make_unsigned_t< T > storage_type
static constexpr storage_type value
static constexpr storage_type value
std::make_unsigned_t< T > storage_type