Do not use static constexpr in header (#863)

Doing so results in each compilation unit (.cpp file) having its own
copy of the variable, while inline constexpr makes sure there is only
one copy.
This commit is contained in:
Cheng
2024-03-21 13:28:05 +09:00
committed by GitHub
parent b219d12a6b
commit e849b3424a
2 changed files with 15 additions and 15 deletions

View File

@@ -10,7 +10,7 @@ struct complex64_t;
struct complex128_t;
template <typename T>
static constexpr bool can_convert_to_complex128 =
inline constexpr bool can_convert_to_complex128 =
!std::is_same_v<T, complex128_t> && std::is_convertible_v<T, double>;
struct complex128_t : public std::complex<double> {
@@ -28,7 +28,7 @@ struct complex128_t : public std::complex<double> {
};
template <typename T>
static constexpr bool can_convert_to_complex64 =
inline constexpr bool can_convert_to_complex64 =
!std::is_same_v<T, complex64_t> && std::is_convertible_v<T, float>;
struct complex64_t : public std::complex<float> {