From 9454e687a32bb812092a990e3bc9162077e48e77 Mon Sep 17 00:00:00 2001 From: datadiode Date: Tue, 20 Jan 2015 15:25:04 -0600 Subject: [PATCH] Specialize std::swap() for Json::Value in a C++ standard compliant way originally from pull #119 --- include/json/value.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/json/value.h b/include/json/value.h index 93112d1..78e7546 100644 --- a/include/json/value.h +++ b/include/json/value.h @@ -1082,6 +1082,14 @@ public: } // namespace Json + +namespace std { +/// Specialize std::swap() for Json::Value. +template<> +inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); } +} + + #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(pop) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)