From a2f3b703acd8ac776a12e7409b505aee46378462 Mon Sep 17 00:00:00 2001 From: Fredrik Sandhei Date: Thu, 29 Feb 2024 22:38:04 +0100 Subject: [PATCH] Lock json_compatible_type behind ifdef for now --- include/nlohmann/detail/meta/type_traits.hpp | 5 +++++ single_include/nlohmann/json.hpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/include/nlohmann/detail/meta/type_traits.hpp b/include/nlohmann/detail/meta/type_traits.hpp index 8747a85e35..d539c5a4fa 100644 --- a/include/nlohmann/detail/meta/type_traits.hpp +++ b/include/nlohmann/detail/meta/type_traits.hpp @@ -684,11 +684,16 @@ inline constexpr bool value_in_range_of(T val) template using bool_constant = std::integral_constant; +// Locking the definition of json_compatible_type behind +// JSON_HAS_THREE_WAY_COMPARISON because it seems difficult to +// make use of this type trait well with friend functions. Fails on SFINAE. +#if JSON_HAS_THREE_WAY_COMPARISON template > struct json_compatible_type { static constexpr auto value = !is_basic_json::value && is_compatible_type::value; }; +#endif /////////////////////////////////////////////////////////////////////////////// // is_c_string diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 44c7f5f3ff..80a34a7562 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -4091,11 +4091,16 @@ inline constexpr bool value_in_range_of(T val) template using bool_constant = std::integral_constant; +// Locking the definition of json_compatible_type behind +// JSON_HAS_THREE_WAY_COMPARISON because it seems difficult to +// make use of this type trait well with friend functions. Fails on SFINAE. +#if JSON_HAS_THREE_WAY_COMPARISON template > struct json_compatible_type { static constexpr auto value = !is_basic_json::value && is_compatible_type::value; }; +#endif /////////////////////////////////////////////////////////////////////////////// // is_c_string