## ObjectExt::UnboxToNullable method


将对象解箱为可空类型。

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


| Parameter | 描述 |
| --- | --- |
| T | 目标类型。 |

| Parameter | Type | 描述 |
| --- | --- | --- |
| obj | const SmartPtr\<Object\>\& | [Object](../../object/) 用于解箱。 |
| 安全 | bool | 如果为 true，则在失败时返回 nullptr，否则抛出 InvalidCastException。 |

### ReturnValue

已解箱的可空值（可能为 null）。

## 另见

* Class [Nullable](../../nullable/)
* Class [SmartPtr](../../smartptr/)
* Class [Object](../../object/)
* Class [ObjectExt](../)
* Namespace [System](../../)
* Library [Aspose.Page for C++](../../../)
