mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Guard redundant constexpr static member redeclarations for C++17+
libeigen/eigen!2299 Closes #3061 Co-authored-by: Pavel Guzenfeld <67074795+PavelGuzenfeld@users.noreply.github.com>
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
62e23f79dd
commit
36ca36d0de
@@ -210,6 +210,8 @@ struct numeric_limits_bfloat16_impl {
|
||||
static EIGEN_CONSTEXPR Eigen::bfloat16 denorm_min() { return Eigen::bfloat16_impl::raw_uint16_to_bfloat16(0x0001); }
|
||||
};
|
||||
|
||||
// Redundant out-of-class definitions are required pre-C++17 but deprecated since.
|
||||
#if EIGEN_COMP_CXXVER < 17
|
||||
template <typename T>
|
||||
EIGEN_CONSTEXPR const bool numeric_limits_bfloat16_impl<T>::is_specialized;
|
||||
template <typename T>
|
||||
@@ -259,6 +261,7 @@ template <typename T>
|
||||
EIGEN_CONSTEXPR const bool numeric_limits_bfloat16_impl<T>::traps;
|
||||
template <typename T>
|
||||
EIGEN_CONSTEXPR const bool numeric_limits_bfloat16_impl<T>::tinyness_before;
|
||||
#endif
|
||||
} // end namespace bfloat16_impl
|
||||
} // end namespace Eigen
|
||||
|
||||
|
||||
@@ -301,6 +301,8 @@ struct numeric_limits_half_impl {
|
||||
static _EIGEN_MAYBE_CONSTEXPR Eigen::half denorm_min() { return Eigen::half_impl::raw_uint16_to_half(0x0001); }
|
||||
};
|
||||
|
||||
// Redundant out-of-class definitions are required pre-C++17 but deprecated since.
|
||||
#if EIGEN_COMP_CXXVER < 17
|
||||
template <typename T>
|
||||
constexpr const bool numeric_limits_half_impl<T>::is_specialized;
|
||||
template <typename T>
|
||||
@@ -350,6 +352,7 @@ template <typename T>
|
||||
constexpr const bool numeric_limits_half_impl<T>::traps;
|
||||
template <typename T>
|
||||
constexpr const bool numeric_limits_half_impl<T>::tinyness_before;
|
||||
#endif
|
||||
} // end namespace half_impl
|
||||
} // end namespace Eigen
|
||||
|
||||
|
||||
Reference in New Issue
Block a user