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:
Florian Albrechtskirchinger 2022-03-08 11:13:57 +01:00
parent 130205e59e
commit d7954b29fc
2 changed files with 12 additions and 4 deletions

View File

@ -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

View File

@ -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