System::ObjectExt::Box 方法

ObjectExt::Box(const String&) method

对字符串值进行装箱。

SmartPtr<Object> System::ObjectExt::Box(const String &value)
参数类型描述
const String&要装箱的值。

ReturnValue

装箱后的值或 null(如果源字符串为 null)。

另见

ObjectExt::Box(const T&) method

将值类型装箱以转换为 Object。针对枚举类型的实现。

template<typename T> static std::enable_if<std::is_enum<T>::value, System::SmartPtr<System::Object>>::type System::ObjectExt::Box(const T &value)
参数描述
TEnum 类型。
参数类型描述
valueconst T&Enum 值进行装箱。

ReturnValue

保持装箱值的对象智能指针。

另见

ObjectExt::Box(const T&) method

将值类型装箱以转换为 Object。针对非枚举类型的实现。

template<typename T> static std::enable_if<!std::is_enum<T>::value &&!IsNullable<T>::value, System::SmartPtr<System::Object>>::type System::ObjectExt::Box(const T &value)
参数描述
T值类型。
参数类型描述
const T&要装箱的值。

ReturnValue

保持装箱值的对象智能指针。

另见

ObjectExt::Box(const T&) method

Nullable 类型装箱以转换为 Object

template<typename T> static std::enable_if<IsNullable<T>::value, System::SmartPtr<System::Object>>::type System::ObjectExt::Box(const T &value)
参数描述
T值类型。
参数类型描述
const T&要装箱的值。

ReturnValue

保持装箱值的对象智能指针。

另见