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)
Parameter | Description |
---|---|
T | Destination type. |
Parameter | Type | Description |
---|---|---|
obj | const SmartPtr<Object>& | Object to unbox. |
safe | bool | If true, return nullptr on failure, otherwise throw InvalidCastException. |
ReturnValue
Unboxed nullable value (could be null).