Equals()

Object::Equals(ptr) method

Compares objects using C# Object.Equals semantics.

virtual bool System::Object::Equals(ptr obj)

Arguments

ParameterTypeDescription
objptrObject to compare current one to.

Return Value

True if objects are considered equal and false otherwise.

Object::Equals(T1 const&, T2 const&) method

Compares reference type objects in C# style.

template<typename T1,typename T2> static std::enable_if<IsSmartPtr<T1>::value &&IsSmartPtr<T2>::value, bool>::type System::Object::Equals(T1 const &objA, T2 const &objB)

Template parameters

ParameterDescription
T1Type of first object to compare.
T2Type of second object to compare.

Arguments

ParameterTypeDescription
objAT1 const&First object to compare.
objBT2 const&Second object to compare.

Return Value

True if objects match either by reference or semantically (by Object.Equals-alike comparison), false otherwise.

Object::Equals(T1 const&, T2 const&) method

Compares value type objects in C# style.

template<typename T1,typename T2> static std::enable_if<!IsSmartPtr<T1>::value &&!IsSmartPtr<T2>::value, bool>::type System::Object::Equals(T1 const &objA, T2 const &objB)

Template parameters

ParameterDescription
T1Type of first object to compare.
T2Type of second object to compare.

Arguments

ParameterTypeDescription
objAT1 const&First object to compare.
objBT2 const&Second object to compare.

Return Value

True if objects are considered equal by equality operator available, false otherwise.

Object::Equals(float const&, float const&) 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::Object::Equals(float const &objA, float const &objB)

Arguments

ParameterTypeDescription
objAfloat const&LHS floating point value.
objBfloat const&RHS floating point value.

Return Value

True if objA and objB are both NaN or equal, false otherwise.

Object::Equals(double const&, double const&) 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::Object::Equals(double const &objA, double const &objB)

Arguments

ParameterTypeDescription
objAdouble const&LHS floating point value.
objBdouble const&RHS floating point value.

Return Value

True if objA and objB are both NaN or equal, false otherwise.

See Also