Fix redefinition of inline constexpr statics
Redelcaration of inline constexpr static data members in namespace scope was deprecated in C++17. Fixes -Werror=deprecated compilation failures.
This commit is contained in:
parent
130205e59e
commit
d7954b29fc
@ -147,8 +147,12 @@ struct static_const
|
||||
static constexpr T value{};
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
constexpr T static_const<T>::value; // NOLINT(readability-redundant-declaration)
|
||||
#ifndef JSON_HAS_CPP_17
|
||||
|
||||
template<typename T>
|
||||
constexpr T static_const<T>::value; // NOLINT(readability-redundant-declaration)
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
} // namespace nlohmann
|
||||
|
||||
@ -3191,8 +3191,12 @@ struct static_const
|
||||
static constexpr T value{};
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
constexpr T static_const<T>::value; // NOLINT(readability-redundant-declaration)
|
||||
#ifndef JSON_HAS_CPP_17
|
||||
|
||||
template<typename T>
|
||||
constexpr T static_const<T>::value; // NOLINT(readability-redundant-declaration)
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
} // namespace nlohmann
|
||||
|
||||
Loading…
Reference in New Issue
Block a user