From 5663bfa6c65a0df2d4f3d25920c5c3a6a703363f Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Wed, 3 Nov 2021 21:25:46 +0100 Subject: [PATCH] :rotating_light: fix -fpermissive warnings --- include/nlohmann/json.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 016d79349..50829e0a4 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -4707,9 +4707,12 @@ std::string to_string(const NLOHMANN_BASIC_JSON_TPL& j) // nonmember support // /////////////////////// +namespace std +{ + /// hash value for JSON objects NLOHMANN_BASIC_JSON_TPL_DECLARATION -struct std::hash +struct hash { /*! @brief return a hash value for a JSON object @@ -4726,7 +4729,7 @@ struct std::hash /// @note: do not remove the space after '<', /// see https://github.com/nlohmann/json/pull/679 template<> -struct std::less< ::nlohmann::detail::value_t> +struct less< ::nlohmann::detail::value_t> { /*! @brief compare two value_t enum values @@ -4742,9 +4745,6 @@ struct std::less< ::nlohmann::detail::value_t> // C++20 prohibit function specialization in the std namespace. #ifndef JSON_HAS_CPP_20 -namespace std -{ - /*! @brief exchanges the values of two JSON objects @@ -4758,10 +4758,10 @@ inline void swap(nlohmann::json& j1, nlohmann::json& j2) noexcep j1.swap(j2); } -} // namespace std - #endif +} // namespace std + /// @brief user-defined string literal for JSON values /// @sa https://json.nlohmann.me/api/basic_json/operator_literal_json/ JSON_HEDLEY_NON_NULL(1)