Skip to content

Commit 1d95628

Browse files
authored
Remove std::swap<Json::Value> in favor of ADL
Comply with http://en.cppreference.com/w/cpp/concept/Swappable Don't open namespace std.
1 parent 3e2b8ea commit 1d95628

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

include/json/value.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -880,14 +880,9 @@ class JSON_API ValueIterator : public ValueIteratorBase {
880880
pointer operator->() const { return &deref(); }
881881
};
882882

883-
} // namespace Json
884-
883+
inline void swap(Value& a, Value& b) { a.swap(b); }
885884

886-
namespace std {
887-
/// Specialize std::swap() for Json::Value.
888-
template<>
889-
inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); }
890-
}
885+
} // namespace Json
891886

892887
#pragma pack(pop)
893888

0 commit comments

Comments
 (0)