mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 02:44:10 +00:00
Replaced left shift of signed integer values with multiplication to keep the expressions constant according to C++11.
This commit is contained in:
parent
db7bba3259
commit
991539725e
@ -67,12 +67,13 @@ struct complement
|
||||
+ Number(UCHAR_MAX));
|
||||
BOOST_STATIC_CONSTANT(Number, min = Number((prev::min) << CHAR_BIT));
|
||||
#else
|
||||
// Avoid left shifting negative integers, use multiplication instead
|
||||
BOOST_STATIC_CONSTANT(Number, shift = 1u << CHAR_BIT);
|
||||
BOOST_STATIC_CONSTANT(Number, max =
|
||||
Number(Number(prev::max) << CHAR_BIT)
|
||||
Number(Number(prev::max) * shift)
|
||||
+ Number(UCHAR_MAX));
|
||||
BOOST_STATIC_CONSTANT(Number, min = Number(Number(prev::min) << CHAR_BIT));
|
||||
BOOST_STATIC_CONSTANT(Number, min = Number(Number(prev::min) * shift));
|
||||
#endif
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user