Skip to content

Commit 9454e68

Browse files
datadiodecdunn2001
authored andcommitted
Specialize std::swap() for Json::Value in a C++ standard compliant way
originally from pull #119
1 parent 46a925b commit 9454e68

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/json/value.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,14 @@ class JSON_API ValueIterator : public ValueIteratorBase {
10821082

10831083
} // namespace Json
10841084

1085+
1086+
namespace std {
1087+
/// Specialize std::swap() for Json::Value.
1088+
template<>
1089+
inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); }
1090+
}
1091+
1092+
10851093
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
10861094
#pragma warning(pop)
10871095
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)

0 commit comments

Comments
 (0)