System::ObjectExt::UnboxToNullable method

ObjectExt::UnboxToNullable method

Unboxes object to nullable type.

template<class T> static Nullable<T> System::ObjectExt::UnboxToNullable(const SmartPtr<Object> &obj, bool safe=true)
ParameterDescription
TDestination type.
ParameterTypeDescription
objconst SmartPtr<Object>&Object to unbox.
safeboolIf true, return nullptr on failure, otherwise throw InvalidCastException.

ReturnValue

Unboxed nullable value (could be null).

See Also