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