16 #include <type_traits>
35 namespace overflow_controlled_integer_accumulator_details
38 template<
typename T,
typename Storage_Type >
40 typename std::enable_if< std::is_signed<T>::value,
bool >::type
47 template<
typename T,
typename Storage_Type >
49 typename std::enable_if< !std::is_signed<T>::value,
bool >::type
58 template<
typename T,
typename Ext >
61 template<
typename T >
67 std::numeric_limits<T>::max() );
70 template<
typename T >
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() );
83 value == (
static_cast<storage_type>(std::numeric_limits<T>::max()) + 1u),
84 "The integer representation is expected to be two's complement" );
158 using namespace overflow_controlled_integer_accumulator_details;
168 is_greater_than_maximum<T>( updated_value, extremum_value::value ) )