28 Jun
2017
28 Jun
'17
9:46 a.m.
constexpr max() is C++11 - the context here is a template parameter if I understand correctly. static_cast<>(-1) works on C++03.
Do any of the macros BOOST_CONSTEXPR, BOOST_CONSTEXPR_OR_CONST, BOOST_STATIC_CONSTEXPR ...
I do not think these macros are useful here: we do not define a function here. We need numeric_limits<UInteger>::max() value at compile time as a template parameter and in C++03, ::max() is not constexpr so that we have to use static_cast<UInteger>(-1) to have it work on all c++ versions. Frédéric