System::ObjectExt::Box method

ObjectExt::Box(const String&) method

Boxes string values.

SmartPtr<Object> System::ObjectExt::Box(const String &value)
ParameterTypeDescription
valueconst String&Value to box.

ReturnValue

Boxed value or null, if source string is null.

See Also

ObjectExt::Box(const T&) method

Boxes value types for converting to Object. Implementation for enum types.

template<typename T> static std::enable_if<std::is_enum<T>::value, System::SmartPtr<System::Object>>::type System::ObjectExt::Box(const T &value)
ParameterDescription
TEnum type.
ParameterTypeDescription
valueconst T&Enum value to box.

ReturnValue

Smart pointer to object keeping boxed value.

See Also

ObjectExt::Box(const T&) method

Boxes value types for converting to Object. Implementation for non-enum types.

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)
ParameterDescription
TValue type.
ParameterTypeDescription
valueconst T&Value to box.

ReturnValue

Smart pointer to object keeping boxed value.

See Also

ObjectExt::Box(const T&) method

Boxes Nullable types for converting to Object.

template<typename T> static std::enable_if<IsNullable<T>::value, System::SmartPtr<System::Object>>::type System::ObjectExt::Box(const T &value)
ParameterDescription
TValue type.
ParameterTypeDescription
valueconst T&Value to box.

ReturnValue

Smart pointer to object keeping boxed value.

See Also