diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 366a8beed..37447262e 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -5518,16 +5518,6 @@ public: #endif } - JSON_HEDLEY_NEVER_INLINE - static bool less_general(const_reference lhs, const_reference rhs) noexcept - { - // default_result is used if we cannot compare values. In that case, - // we compare types. Note we have to call the operator explicitly, - // because MSVC has problems otherwise. - JSON_IMPLEMENT_OPERATOR( <, false, false, operator<(lhs_type, rhs_type), - compare_iteratively(lhs, rhs, true) == compare_result::less, false) - } - #if JSON_HAS_THREE_WAY_COMPARISON JSON_HEDLEY_NEVER_INLINE static std::partial_ordering three_way_general(const_reference lhs, const_reference rhs) noexcept // *NOPAD* @@ -5540,6 +5530,16 @@ public: lhs_type <=> rhs_type, // *NOPAD* to_partial_ordering(compare_iteratively(lhs, rhs, false)), true) } +#else + JSON_HEDLEY_NEVER_INLINE + static bool less_general(const_reference lhs, const_reference rhs) noexcept + { + // default_result is used if we cannot compare values. In that case, + // we compare types. Note we have to call the operator explicitly, + // because MSVC has problems otherwise. + JSON_IMPLEMENT_OPERATOR( <, false, false, operator<(lhs_type, rhs_type), + compare_iteratively(lhs, rhs, true) == compare_result::less, false) + } #endif /// @brief compare two leaves of the same type inside equal_structured() diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index f44422cd6..bcc8e5831 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -35552,16 +35552,6 @@ public: #endif } - JSON_HEDLEY_NEVER_INLINE - static bool less_general(const_reference lhs, const_reference rhs) noexcept - { - // default_result is used if we cannot compare values. In that case, - // we compare types. Note we have to call the operator explicitly, - // because MSVC has problems otherwise. - JSON_IMPLEMENT_OPERATOR( <, false, false, operator<(lhs_type, rhs_type), - compare_iteratively(lhs, rhs, true) == compare_result::less, false) - } - #if JSON_HAS_THREE_WAY_COMPARISON JSON_HEDLEY_NEVER_INLINE static std::partial_ordering three_way_general(const_reference lhs, const_reference rhs) noexcept // *NOPAD* @@ -35574,6 +35564,16 @@ public: lhs_type <=> rhs_type, // *NOPAD* to_partial_ordering(compare_iteratively(lhs, rhs, false)), true) } +#else + JSON_HEDLEY_NEVER_INLINE + static bool less_general(const_reference lhs, const_reference rhs) noexcept + { + // default_result is used if we cannot compare values. In that case, + // we compare types. Note we have to call the operator explicitly, + // because MSVC has problems otherwise. + JSON_IMPLEMENT_OPERATOR( <, false, false, operator<(lhs_type, rhs_type), + compare_iteratively(lhs, rhs, true) == compare_result::less, false) + } #endif /// @brief compare two leaves of the same type inside equal_structured()