Use swap() by ADL
This commit is contained in:
parent
2d48a4d9c5
commit
f4946eb8ef
@ -3447,7 +3447,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
// swap only works for arrays
|
||||
if (JSON_HEDLEY_LIKELY(is_array()))
|
||||
{
|
||||
std::swap(*(m_value.array), other);
|
||||
using std::swap;
|
||||
swap(*(m_value.array), other);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3462,7 +3463,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
// swap only works for objects
|
||||
if (JSON_HEDLEY_LIKELY(is_object()))
|
||||
{
|
||||
std::swap(*(m_value.object), other);
|
||||
using std::swap;
|
||||
swap(*(m_value.object), other);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3477,7 +3479,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
// swap only works for strings
|
||||
if (JSON_HEDLEY_LIKELY(is_string()))
|
||||
{
|
||||
std::swap(*(m_value.string), other);
|
||||
using std::swap;
|
||||
swap(*(m_value.string), other);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3492,7 +3495,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
// swap only works for strings
|
||||
if (JSON_HEDLEY_LIKELY(is_binary()))
|
||||
{
|
||||
std::swap(*(m_value.binary), other);
|
||||
using std::swap;
|
||||
swap(*(m_value.binary), other);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3507,7 +3511,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
// swap only works for strings
|
||||
if (JSON_HEDLEY_LIKELY(is_binary()))
|
||||
{
|
||||
std::swap(*(m_value.binary), other);
|
||||
using std::swap;
|
||||
swap(*(m_value.binary), other);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -22274,7 +22274,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
// swap only works for arrays
|
||||
if (JSON_HEDLEY_LIKELY(is_array()))
|
||||
{
|
||||
std::swap(*(m_value.array), other);
|
||||
using std::swap;
|
||||
swap(*(m_value.array), other);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -22289,7 +22290,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
// swap only works for objects
|
||||
if (JSON_HEDLEY_LIKELY(is_object()))
|
||||
{
|
||||
std::swap(*(m_value.object), other);
|
||||
using std::swap;
|
||||
swap(*(m_value.object), other);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -22304,7 +22306,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
// swap only works for strings
|
||||
if (JSON_HEDLEY_LIKELY(is_string()))
|
||||
{
|
||||
std::swap(*(m_value.string), other);
|
||||
using std::swap;
|
||||
swap(*(m_value.string), other);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -22319,7 +22322,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
// swap only works for strings
|
||||
if (JSON_HEDLEY_LIKELY(is_binary()))
|
||||
{
|
||||
std::swap(*(m_value.binary), other);
|
||||
using std::swap;
|
||||
swap(*(m_value.binary), other);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -22334,7 +22338,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
// swap only works for strings
|
||||
if (JSON_HEDLEY_LIKELY(is_binary()))
|
||||
{
|
||||
std::swap(*(m_value.binary), other);
|
||||
using std::swap;
|
||||
swap(*(m_value.binary), other);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user