From 1d95628ba84189cd81fbabf70add5c1baf2912c5 Mon Sep 17 00:00:00 2001 From: Billy Donahue Date: Tue, 6 Mar 2018 12:51:58 -0500 Subject: [PATCH] Remove std::swap in favor of ADL Comply with http://en.cppreference.com/w/cpp/concept/Swappable Don't open namespace std. --- include/json/value.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/include/json/value.h b/include/json/value.h index 8d049ad..2643782 100644 --- a/include/json/value.h +++ b/include/json/value.h @@ -880,15 +880,10 @@ public: pointer operator->() const { return &deref(); } }; +inline void swap(Value& a, Value& b) { a.swap(b); } + } // namespace Json - -namespace std { -/// Specialize std::swap() for Json::Value. -template<> -inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); } -} - #pragma pack(pop) #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)