Port changes from fpm's mainstream.

This commit is contained in:
Roman Telezhynskyi 2022-09-20 11:13:12 +03:00
parent 7d6ad602f5
commit d3205b853c

View file

@ -435,7 +435,7 @@ struct numeric_limits<fpm::fixed<B,I,F>>
static constexpr bool has_infinity = false;
static constexpr bool has_quiet_NaN = false;
static constexpr bool has_signaling_NaN = false;
static constexpr bool has_denorm = std::denorm_absent;
static constexpr std::float_denorm_style has_denorm = std::denorm_absent;
static constexpr bool has_denorm_loss = false;
static constexpr std::float_round_style round_style = std::round_to_nearest;
static constexpr bool is_iec_559 = false;
@ -492,6 +492,56 @@ struct numeric_limits<fpm::fixed<B,I,F>>
}
};
// See https://stackoverflow.com/a/46719572/3045403
#if __cplusplus < 201703L
template <typename B, typename I, unsigned int F>
constexpr bool numeric_limits<fpm::fixed<B,I,F>>::is_specialized; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr bool numeric_limits<fpm::fixed<B,I,F>>::is_signed; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr bool numeric_limits<fpm::fixed<B,I,F>>::is_integer; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr bool numeric_limits<fpm::fixed<B,I,F>>::is_exact; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr bool numeric_limits<fpm::fixed<B,I,F>>::has_infinity; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr bool numeric_limits<fpm::fixed<B,I,F>>::has_quiet_NaN; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr bool numeric_limits<fpm::fixed<B,I,F>>::has_signaling_NaN; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr std::float_denorm_style numeric_limits<fpm::fixed<B,I,F>>::has_denorm; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr bool numeric_limits<fpm::fixed<B,I,F>>::has_denorm_loss; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr std::float_round_style numeric_limits<fpm::fixed<B,I,F>>::round_style; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr bool numeric_limits<fpm::fixed<B,I,F>>::is_iec_559; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr bool numeric_limits<fpm::fixed<B,I,F>>::is_bounded; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr bool numeric_limits<fpm::fixed<B,I,F>>::is_modulo; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr int numeric_limits<fpm::fixed<B,I,F>>::digits; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr int numeric_limits<fpm::fixed<B,I,F>>::digits10; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr int numeric_limits<fpm::fixed<B,I,F>>::max_digits10; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr int numeric_limits<fpm::fixed<B,I,F>>::radix; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr int numeric_limits<fpm::fixed<B,I,F>>::min_exponent; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr int numeric_limits<fpm::fixed<B,I,F>>::min_exponent10; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr int numeric_limits<fpm::fixed<B,I,F>>::max_exponent; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr int numeric_limits<fpm::fixed<B,I,F>>::max_exponent10; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr bool numeric_limits<fpm::fixed<B,I,F>>::traps; // NOLINT(readability-redundant-declaration)
template <typename B, typename I, unsigned int F>
constexpr bool numeric_limits<fpm::fixed<B,I,F>>::tinyness_before; // NOLINT(readability-redundant-declaration)
#endif
} // namespace std
#endif