z
will be an
int
. This is a consequence for the standard rules for type
promotion for C/C++ arithmetic. A key feature of library permits one to
specify his own type promotion rules via a PromotionPolicy class.PP
T, U
R
PP::addition_result<T,
U>::type
PP::subtraction_result<T,
U>::type
PP::multiplication_result<T,
U>::type
PP::division_result<T,
U>::type
PP::modulus_result<T, U>::type
PP::comparison_result<T,
U>::type
PP::left_shift_result<T,
U>::type
PP::right_shift_result<T,
u>::type
PP::bitwise_or_result<T,
U>::type
PP::bitwise_and_result<T,
U>::type
PP::bitwise_xor_result<T,
U>::type
boost::numeric::native
int
. If the result exceeds the maximum value
that can be stored in an int
, an error is
detected.native
policy is documented in Promotion Policies -
native.boost::numeric::automatic
#include
<boost/numeric/safe_numerics/concepts/promotion_policy.hpp>