Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable warnings from deprecated numeric_limits members. #575

Merged
merged 3 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions include/boost/multiprecision/cpp_bin_float.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2154,7 +2154,14 @@ class numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_bi
static constexpr bool has_infinity = true;
static constexpr bool has_quiet_NaN = true;
static constexpr bool has_signaling_NaN = false;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4996)
#endif
static constexpr float_denorm_style has_denorm = denorm_absent;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
static constexpr bool has_denorm_loss = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the instances of has_denorm_loss need to go in between the pragmas since it's deprecated as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe so... it's a simple bool so no warning is generated, it's our use of float_denorm_style that was causing the issue I believe.

static number_type infinity()
{
Expand Down Expand Up @@ -2209,8 +2216,15 @@ template <unsigned Digits, boost::multiprecision::backends::digit_base_type Digi
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>, ExpressionTemplates> >::has_quiet_NaN;
template <unsigned Digits, boost::multiprecision::backends::digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>, ExpressionTemplates> >::has_signaling_NaN;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4996)
#endif
template <unsigned Digits, boost::multiprecision::backends::digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr float_denorm_style numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>, ExpressionTemplates> >::has_denorm;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
template <unsigned Digits, boost::multiprecision::backends::digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>, ExpressionTemplates> >::has_denorm_loss;
template <unsigned Digits, boost::multiprecision::backends::digit_base_type DigitBase, class Allocator, class Exponent, Exponent MinE, Exponent MaxE, boost::multiprecision::expression_template_option ExpressionTemplates>
Expand Down
14 changes: 14 additions & 0 deletions include/boost/multiprecision/cpp_dec_float.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3578,7 +3578,14 @@ class numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_de
static constexpr bool has_infinity = true;
static constexpr bool has_quiet_NaN = true;
static constexpr bool has_signaling_NaN = false;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
static constexpr std::float_denorm_style has_denorm = std::denorm_absent;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
static constexpr bool has_denorm_loss = false;
static constexpr bool traps = false;
static constexpr bool tinyness_before = false;
Expand Down Expand Up @@ -3622,8 +3629,15 @@ template <unsigned Digits10, class ExponentType, class Allocator, boost::multipr
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::has_quiet_NaN;
template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::has_signaling_NaN;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr float_denorm_style numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::has_denorm;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_dec_float<Digits10, ExponentType, Allocator>, ExpressionTemplates> >::has_denorm_loss;
template <unsigned Digits10, class ExponentType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
Expand Down
14 changes: 14 additions & 0 deletions include/boost/multiprecision/cpp_int/limits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,14 @@ class numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_in
static constexpr bool has_infinity = false;
static constexpr bool has_quiet_NaN = false;
static constexpr bool has_signaling_NaN = false;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4996)
#endif
static constexpr float_denorm_style has_denorm = denorm_absent;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
static constexpr bool has_denorm_loss = false;
static BOOST_CXX14_CONSTEXPR_IF_DETECTION number_type infinity() { return 0; }
static BOOST_CXX14_CONSTEXPR_IF_DETECTION number_type quiet_NaN() { return 0; }
Expand Down Expand Up @@ -242,8 +249,15 @@ template <std::size_t MinBits, std::size_t MaxBits, boost::multiprecision::cpp_i
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<MinBits, MaxBits, SignType, Checked, Allocator>, ExpressionTemplates> >::has_quiet_NaN;
template <std::size_t MinBits, std::size_t MaxBits, boost::multiprecision::cpp_integer_type SignType, boost::multiprecision::cpp_int_check_type Checked, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<MinBits, MaxBits, SignType, Checked, Allocator>, ExpressionTemplates> >::has_signaling_NaN;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4996)
#endif
template <std::size_t MinBits, std::size_t MaxBits, boost::multiprecision::cpp_integer_type SignType, boost::multiprecision::cpp_int_check_type Checked, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr float_denorm_style numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<MinBits, MaxBits, SignType, Checked, Allocator>, ExpressionTemplates> >::has_denorm;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
template <std::size_t MinBits, std::size_t MaxBits, boost::multiprecision::cpp_integer_type SignType, boost::multiprecision::cpp_int_check_type Checked, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<MinBits, MaxBits, SignType, Checked, Allocator>, ExpressionTemplates> >::has_denorm_loss;
template <std::size_t MinBits, std::size_t MaxBits, boost::multiprecision::cpp_integer_type SignType, boost::multiprecision::cpp_int_check_type Checked, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
Expand Down
18 changes: 16 additions & 2 deletions include/boost/multiprecision/float128.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,15 @@ class numeric_limits<boost::multiprecision::number<boost::multiprecision::backen
static constexpr bool has_infinity = true;
static constexpr bool has_quiet_NaN = true;
static constexpr bool has_signaling_NaN = false;
static constexpr float_denorm_style has_denorm = denorm_present;
static constexpr bool has_denorm_loss = true;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
static constexpr float_denorm_style has_denorm = denorm_present;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
static constexpr bool has_denorm_loss = true;
static BOOST_MP_CXX14_CONSTEXPR number_type infinity() { return HUGE_VAL; /* conversion from double infinity OK */ }
static BOOST_MP_CXX14_CONSTEXPR number_type quiet_NaN() { return number_type(NAN); }
static BOOST_MP_CXX14_CONSTEXPR number_type signaling_NaN() { return 0; }
Expand Down Expand Up @@ -898,8 +905,15 @@ constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecisio

template <boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr float_round_style numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::round_style;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
template <boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr float_denorm_style numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> >::has_denorm;
#ifdef _MSC_VER
#pragma warning(pop)
#endif

} // namespace std

Expand Down
72 changes: 64 additions & 8 deletions include/boost/multiprecision/gmp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3590,8 +3590,15 @@ class numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_fl
static constexpr bool has_infinity = false;
static constexpr bool has_quiet_NaN = false;
static constexpr bool has_signaling_NaN = false;
static constexpr float_denorm_style has_denorm = denorm_absent;
static constexpr bool has_denorm_loss = false;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
static constexpr float_denorm_style has_denorm = denorm_absent;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
static constexpr bool has_denorm_loss = false;
static constexpr number_type infinity() { return number_type(); }
static constexpr number_type quiet_NaN() { return number_type(); }
static constexpr number_type signaling_NaN() { return number_type(); }
Expand Down Expand Up @@ -3632,8 +3639,15 @@ template <unsigned Digits10, boost::multiprecision::expression_template_option E
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_float<Digits10>, ExpressionTemplates> >::has_quiet_NaN;
template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_float<Digits10>, ExpressionTemplates> >::has_signaling_NaN;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr float_denorm_style numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_float<Digits10>, ExpressionTemplates> >::has_denorm;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_float<Digits10>, ExpressionTemplates> >::has_denorm_loss;
template <unsigned Digits10, boost::multiprecision::expression_template_option ExpressionTemplates>
Expand Down Expand Up @@ -3675,8 +3689,15 @@ class numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_fl
static constexpr bool has_infinity = false;
static constexpr bool has_quiet_NaN = false;
static constexpr bool has_signaling_NaN = false;
static constexpr float_denorm_style has_denorm = denorm_absent;
static constexpr bool has_denorm_loss = false;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
static constexpr float_denorm_style has_denorm = denorm_absent;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
static constexpr bool has_denorm_loss = false;
static number_type infinity() { return number_type(); }
static number_type quiet_NaN() { return number_type(); }
static number_type signaling_NaN() { return number_type(); }
Expand Down Expand Up @@ -3717,8 +3738,15 @@ template <boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_float<0>, ExpressionTemplates> >::has_quiet_NaN;
template <boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_float<0>, ExpressionTemplates> >::has_signaling_NaN;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
template <boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr float_denorm_style numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_float<0>, ExpressionTemplates> >::has_denorm;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
template <boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_float<0>, ExpressionTemplates> >::has_denorm_loss;
template <boost::multiprecision::expression_template_option ExpressionTemplates>
Expand Down Expand Up @@ -3770,8 +3798,15 @@ class numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_in
static constexpr bool has_infinity = false;
static constexpr bool has_quiet_NaN = false;
static constexpr bool has_signaling_NaN = false;
static constexpr float_denorm_style has_denorm = denorm_absent;
static constexpr bool has_denorm_loss = false;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
static constexpr float_denorm_style has_denorm = denorm_absent;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
static constexpr bool has_denorm_loss = false;
static number_type infinity() { return number_type(); }
static number_type quiet_NaN() { return number_type(); }
static number_type signaling_NaN() { return number_type(); }
Expand Down Expand Up @@ -3812,8 +3847,15 @@ template <boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_int, ExpressionTemplates> >::has_quiet_NaN;
template <boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_int, ExpressionTemplates> >::has_signaling_NaN;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
template <boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr float_denorm_style numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_int, ExpressionTemplates> >::has_denorm;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
template <boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_int, ExpressionTemplates> >::has_denorm_loss;
template <boost::multiprecision::expression_template_option ExpressionTemplates>
Expand Down Expand Up @@ -3866,8 +3908,15 @@ class numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_ra
static constexpr bool has_infinity = false;
static constexpr bool has_quiet_NaN = false;
static constexpr bool has_signaling_NaN = false;
static constexpr float_denorm_style has_denorm = denorm_absent;
static constexpr bool has_denorm_loss = false;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
static constexpr float_denorm_style has_denorm = denorm_absent;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
static constexpr bool has_denorm_loss = false;
static number_type infinity() { return number_type(); }
static number_type quiet_NaN() { return number_type(); }
static number_type signaling_NaN() { return number_type(); }
Expand Down Expand Up @@ -3908,8 +3957,15 @@ template <boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_rational, ExpressionTemplates> >::has_quiet_NaN;
template <boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_rational, ExpressionTemplates> >::has_signaling_NaN;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
template <boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr float_denorm_style numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_rational, ExpressionTemplates> >::has_denorm;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
template <boost::multiprecision::expression_template_option ExpressionTemplates>
constexpr bool numeric_limits<boost::multiprecision::number<boost::multiprecision::gmp_rational, ExpressionTemplates> >::has_denorm_loss;
template <boost::multiprecision::expression_template_option ExpressionTemplates>
Expand Down
Loading