2
3
6
7
8
9
10
14#include <restinio/compiler_features.hpp>
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" );
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
153
154
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
std::enable_if<!std::is_signed< T >::value, bool >::type is_greater_than_maximum(Storage_Type, Storage_Type)
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