UnboxToNullable()

ObjectExt::UnboxToNullable(const SmartPtr<Object>&, bool) method

Unboxes object to nullable type.

template<class T> static Nullable<T> System::ObjectExt::UnboxToNullable(const SmartPtr<Object> &obj, bool safe=1)

Template parameters

ParameterDescription
TDestination type.

Arguments

ParameterTypeDescription
objconst SmartPtr<Object>&Object to unbox.
safeboolIf true, return nullptr on failure, otherwise throw InvalidCastException.

Return Value

Unboxed nullable value (could be null).

See Also