Equals()

ObjectExt::Equals(const T&, const T2&) method

template<typename T,typename T2> static std::enable_if<IsExceptionWrapper<T>::value, bool>::type System::ObjectExt::Equals(const T &obj, const T2 &another)

ObjectExt::Equals(const T&, const T2&) method

Substitution for C# Object.Equals calls working for any type in C++. Overload for smart pointer types.

template<typename T,typename T2> static std::enable_if<IsSmartPtr<T>::value, bool>::type System::ObjectExt::Equals(const T &obj, const T2 &another)

Template parameters

ParameterDescription
TFirst object type.
T2Second object type.

Arguments

ParameterTypeDescription
objconst T&First object.
anotherconst T2&Second object.

Return Value

True if objects are considered equal, false otherwise.

ObjectExt::Equals(T, const T2&) method

Substitution for C# Object.Equals calls working for any type in C++. Overload for structure types.

template<typename T,typename T2> static std::enable_if<!IsExceptionWrapper<T>::value &&!IsSmartPtr<T>::value &&!std::is_scalar<T>::value, bool>::type System::ObjectExt::Equals(T obj, const T2 &another)

Template parameters

ParameterDescription
TFirst object type.
T2Second object type.

Arguments

ParameterTypeDescription
objTFirst object.
anotherconst T2&Second object.

Return Value

True if objects are considered equal, false otherwise.

ObjectExt::Equals(const T&, const T2&) method

Substitution for C# Object.Equals calls working for any type in C++. Overload for scalar types.

template<typename T,typename T2> static std::enable_if<!IsSmartPtr<T>::value &&std::is_scalar<T>::value, bool>::type System::ObjectExt::Equals(const T &obj, const T2 &another)

Template parameters

ParameterDescription
TFirst object type.
T2Second object type.

Arguments

ParameterTypeDescription
objconst T&First object.
anotherconst T2&Second object.

Return Value

True if objects are considered equal, false otherwise.

ObjectExt::Equals(const char_t(&), String) method

Substitution for C# Object.Equals calls working for any type in C++. Overload for string literal with string comparison.

template<size_t> static bool System::ObjectExt::Equals(const char_t(&obj)[N], String another)

Template parameters

ParameterDescription
NString literal size.

Arguments

ParameterTypeDescription
objconst char_t(&)String literal.
anotherStringString.

Return Value

True if strings match, false otherwise.

ObjectExt::Equals(const float&, const float&) method

Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.

bool System::ObjectExt::Equals(const float &obj, const float &another)

Arguments

ParameterTypeDescription
objconst float&LHS floating point value.
anotherconst float&RHS floating point value.

Return Value

True if obj and another are both NaN or equal, false otherwise.

ObjectExt::Equals(const double&, const double&) method

Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.

bool System::ObjectExt::Equals(const double &obj, const double &another)

Arguments

ParameterTypeDescription
objconst double&LHS floating point value.
anotherconst double&RHS floating point value.

Return Value

True if obj and another are both NaN or equal, false otherwise.

See Also