ReferenceEquals()

Object::ReferenceEquals(String const&, std::nullptr_t) method

Specialization of Object::ReferenceEquals for case of string and nullptr.

bool System::Object::ReferenceEquals(String const &str, std::nullptr_t)

Arguments

ParameterTypeDescription
strString const&String to compare to nullptr.

Return Value

true if string is null, false otherwise.

Object::ReferenceEquals(String const&, String const&) method

Specialization of Object::ReferenceEquals for case of strings.

bool System::Object::ReferenceEquals(String const &str1, String const &str2)

Arguments

ParameterTypeDescription
str1String const&First string to compare.
str2String const&Second string to compare.

Return Value

true if strings match, false otherwise.

Object::ReferenceEquals(ptr const&, ptr const&) method

Compares objects by reference.

static bool System::Object::ReferenceEquals(ptr const &objA, ptr const &objB)

Arguments

ParameterTypeDescription
objAptr const&First pointer to compare.
objBptr const&Second pointer to compare.

Return Value

True if pointers match and false otherwise.

Object::ReferenceEquals(T const&, T const&) method

Compares objects by reference.

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

Template parameters

ParameterDescription
TType of objects to compare.

Arguments

ParameterTypeDescription
objAT const&First object to compare.
objBT const&Second object to compare.

Return Value

True if object addresses match and false otherwise.

Object::ReferenceEquals(T const&, std::nullptr_t) method

Reference-compares value type object with nullptr.

template<typename T> static std::enable_if<!IsSmartPtr<T>::value, bool>::type System::Object::ReferenceEquals(T const &objA, std::nullptr_t)

Template parameters

ParameterDescription
TType of object to compare.

Arguments

ParameterTypeDescription
objAT const&First object to compare.

Return Value

Always returns false as value types cannot be nulled.

See Also