From 4d780b091bfb3d459cfcc9aa979d2867a57fa377 Mon Sep 17 00:00:00 2001 From: David Guthrie Date: Tue, 18 Sep 2018 16:38:59 -0400 Subject: [PATCH] Reordered the code. It seems to stop clang 3.4.2 in RHEL 7 from crashing intermittently. --- include/nlohmann/json.hpp | 27 ++++++++++++++------------- single_include/nlohmann/json.hpp | 27 ++++++++++++++------------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 9e1ed002..598aa06b 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -7691,19 +7691,6 @@ class basic_json // specialization of std::swap, and std::hash namespace std { -/*! -@brief exchanges the values of two JSON objects - -@since version 1.0.0 -*/ -template<> -inline void swap(nlohmann::json& j1, nlohmann::json& j2) noexcept( - is_nothrow_move_constructible::value and - is_nothrow_move_assignable::value -) -{ - j1.swap(j2); -} /// hash value for JSON objects template<> @@ -7739,6 +7726,20 @@ struct less< ::nlohmann::detail::value_t> } }; +/*! +@brief exchanges the values of two JSON objects + +@since version 1.0.0 +*/ +template<> +inline void swap(nlohmann::json& j1, nlohmann::json& j2) noexcept( + is_nothrow_move_constructible::value and + is_nothrow_move_assignable::value +) +{ + j1.swap(j2); +} + } // namespace std /*! diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 3d7967bb..46cf8b18 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -18764,19 +18764,6 @@ class basic_json // specialization of std::swap, and std::hash namespace std { -/*! -@brief exchanges the values of two JSON objects - -@since version 1.0.0 -*/ -template<> -inline void swap(nlohmann::json& j1, nlohmann::json& j2) noexcept( - is_nothrow_move_constructible::value and - is_nothrow_move_assignable::value -) -{ - j1.swap(j2); -} /// hash value for JSON objects template<> @@ -18812,6 +18799,20 @@ struct less< ::nlohmann::detail::value_t> } }; +/*! +@brief exchanges the values of two JSON objects + +@since version 1.0.0 +*/ +template<> +inline void swap(nlohmann::json& j1, nlohmann::json& j2) noexcept( + is_nothrow_move_constructible::value and + is_nothrow_move_assignable::value +) +{ + j1.swap(j2); +} + } // namespace std /*!