diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index a7adb724f..e5a7917c5 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -3063,7 +3063,10 @@ class basic_json @since version 2.1.0 */ template < typename ValueTypeCV, typename ValueType = detail::uncvref_t> - constexpr auto get() const noexcept( +#if defined(JSON_HAS_CPP_14) + constexpr +#endif + auto get() const noexcept( noexcept(std::declval().template get_impl(detail::priority_tag<4> {}))) -> decltype(std::declval().template get_impl(detail::priority_tag<4> {})) { diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index f7ee9030b..7ce313829 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -19815,7 +19815,10 @@ class basic_json @since version 2.1.0 */ template < typename ValueTypeCV, typename ValueType = detail::uncvref_t> - constexpr auto get() const noexcept( +#if defined(JSON_HAS_CPP_14) + constexpr +#endif + auto get() const noexcept( noexcept(std::declval().template get_impl(detail::priority_tag<4> {}))) -> decltype(std::declval().template get_impl(detail::priority_tag<4> {})) {