System::Object::Equals method

Object::Equals(ptr) method

Compares objects using C# Object.Equals semantics.

virtual bool System::Object::Equals(ptr obj)
ParameterTypeDescription
objptrObject to compare current one to.

ReturnValue

True if objects are considered equal and false otherwise.

See Also

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)
ParameterTypeDescription
objAdouble const&LHS floating point value.
objBdouble const&RHS floating point value.

ReturnValue

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

See Also

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)
ParameterTypeDescription
objAfloat const&LHS floating point value.
objBfloat const&RHS floating point value.

ReturnValue

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

See Also

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)
ParameterDescription
T1Type of first object to compare.
T2Type of second object to compare.
ParameterTypeDescription
objAT1 const&First object to compare.
objBT2 const&Second object to compare.

ReturnValue

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

See Also

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)
ParameterDescription
T1Type of first object to compare.
T2Type of second object to compare.
ParameterTypeDescription
objAT1 const&First object to compare.
objBT2 const&Second object to compare.

ReturnValue

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

See Also