System::ObjectExt::Equals 方法

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

替代 C# Object.Equals 调用,适用于 C++ 中的任何类型。针对字符串字面量的重载,使用字符串比较。

template<size_t> static bool System::ObjectExt::Equals(const char_t(&obj)[N], String another)
Parameter描述
NString 字面量大小。
ParameterType描述
objconst char_t(&)String 字面量。
anotherStringString

ReturnValue

如果字符串匹配,则为真,否则为假。

另见

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

模拟 C# 风格的浮点比较,其中两个 NaN 被视为相等,尽管根据 IEC 60559:1989 标准,NaN 不等于任何值,包括 NaN 本身。

bool System::ObjectExt::Equals(const double &obj, const double &another)
ParameterType描述
objconst double&左侧浮点值。
另一个const double&右侧浮点值。

ReturnValue

如果 objanother 都是 NaN 或相等,则为真,否则为假。

另见

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

模拟 C# 风格的浮点比较,其中两个 NaN 被视为相等,尽管根据 IEC 60559:1989 标准,NaN 不等于任何值,包括 NaN 本身。

bool System::ObjectExt::Equals(const float &obj, const float &another)
ParameterType描述
objconst float&左侧浮点值。
另一个const float&右侧浮点值。

ReturnValue

如果 objanother 都是 NaN 或相等,则为真,否则为假。

另见

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

C# Object.Equals 调用的替代实现,适用于 C++ 中的任何类型。针对智能指针类型的重载。

template<typename T,typename T2> static std::enable_if<IsSmartPtr<T>::value, bool>::type System::ObjectExt::Equals(const T &obj, const T2 &another)
Parameter描述
T第一个对象类型。
T2第二个对象类型。
ParameterType描述
objconst T&第一个对象。
另一个const T2&第二个对象。

ReturnValue

如果对象被视为相等,则为真,否则为假。

另见

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

C# Object.Equals 调用的替代实现,适用于 C++ 中的任何类型。针对标量类型的重载。

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)
Parameter描述
T第一个对象类型。
T2第二个对象类型。
ParameterType描述
objconst T&第一个对象。
另一个const T2&第二个对象。

ReturnValue

如果对象被视为相等,则为真,否则为假。

另见

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

C# Object.Equals 调用的替代实现,适用于 C++ 中的任何类型。针对结构体类型的重载。

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)
Parameter描述
T第一个对象类型。
T2第二个对象类型。
ParameterType描述
objT第一个对象。
另一个const T2&第二个对象。

ReturnValue

如果对象被视为相等,则为真,否则为假。

另见