Fix operator== overload ambiguity
This commit is contained in:
parent
b5d1755dfb
commit
435fc32a69
@ -5534,7 +5534,9 @@ class basic_json
|
||||
@copydoc operator==(const_reference, const_reference)
|
||||
*/
|
||||
template < typename ScalarType, typename std::enable_if <
|
||||
std::is_scalar<ScalarType>::value, int>::type = 0>
|
||||
std::is_scalar<ScalarType>::value, int >::type = 0,
|
||||
typename std::enable_if <
|
||||
std::is_same<std::nullptr_t, std::remove_cv<ScalarType>>::value, int >::type = 0 >
|
||||
friend bool operator==(const_reference lhs, const ScalarType rhs) noexcept
|
||||
{
|
||||
return (lhs == basic_json(rhs));
|
||||
@ -5545,7 +5547,9 @@ class basic_json
|
||||
@copydoc operator==(const_reference, const_reference)
|
||||
*/
|
||||
template < typename ScalarType, typename std::enable_if <
|
||||
std::is_scalar<ScalarType>::value, int>::type = 0>
|
||||
std::is_scalar<ScalarType>::value, int >::type = 0,
|
||||
typename std::enable_if <
|
||||
std::is_same<std::nullptr_t, std::remove_cv<ScalarType>>::value, int >::type = 0 >
|
||||
friend bool operator==(const ScalarType lhs, const_reference rhs) noexcept
|
||||
{
|
||||
return (basic_json(lhs) == rhs);
|
||||
|
||||
@ -15175,7 +15175,9 @@ class basic_json
|
||||
@copydoc operator==(const_reference, const_reference)
|
||||
*/
|
||||
template < typename ScalarType, typename std::enable_if <
|
||||
std::is_scalar<ScalarType>::value, int>::type = 0>
|
||||
std::is_scalar<ScalarType>::value, int >::type = 0,
|
||||
typename std::enable_if <
|
||||
!std::is_same<std::nullptr_t, std::remove_cv<ScalarType>>::value, int >::type = 0 >
|
||||
friend bool operator==(const_reference lhs, const ScalarType rhs) noexcept
|
||||
{
|
||||
return (lhs == basic_json(rhs));
|
||||
@ -15186,7 +15188,9 @@ class basic_json
|
||||
@copydoc operator==(const_reference, const_reference)
|
||||
*/
|
||||
template < typename ScalarType, typename std::enable_if <
|
||||
std::is_scalar<ScalarType>::value, int>::type = 0>
|
||||
std::is_scalar<ScalarType>::value, int >::type = 0,
|
||||
typename std::enable_if <
|
||||
!std::is_same<std::nullptr_t, std::remove_cv<ScalarType>>::value, int >::type = 0 >
|
||||
friend bool operator==(const ScalarType lhs, const_reference rhs) noexcept
|
||||
{
|
||||
return (basic_json(lhs) == rhs);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user