## System::AsCast(const Source\&) method


使用 'as' 运算符将源类型转换为结果类型。用于在需要简单的类似构造函数的转换时。

```cpp
template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Static, Result> System::AsCast(const Source &value)
```


| Parameter | 描述 |
| --- | --- |
| 源 | 源类型。 |
| Result | 结果类型。 |

| Parameter | Type | 描述 |
| --- | --- | --- |
| value | const Source\& | [Object](../object/) 要转换。 |

### ReturnValue

转换结果。

## 另见

* Namespace [System](../)
* Library [Aspose.Page for C++](../../)
## System::AsCast(const Source\&) method


使用 'as' 运算符将源类型转换为结果类型。用于源类型和结果类型相同的情况。

```cpp
template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::None, Result> System::AsCast(const Source &value)
```


| Parameter | 描述 |
| --- | --- |
| 源 | 源类型。 |
| Result | 结果类型。 |

| Parameter | Type | 描述 |
| --- | --- | --- |
| value | const Source\& | [Object](../object/) 要转换。 |

### ReturnValue

转换结果。

## 另见

* Enum [Base64FormattingOptions](../base64formattingoptions/)
* Namespace [System](../)
* Library [Aspose.Page for C++](../../)
## System::AsCast(const Source\&) method


使用 'as' 运算符将源类型转换为结果类型。用于异常包装器。

```cpp
template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Exception, Result> System::AsCast(const Source &value)
```


| Parameter | 描述 |
| --- | --- |
| 源 | 源类型。 |
| Result | 结果类型。 |

| Parameter | Type | 描述 |
| --- | --- | --- |
| value | const Source\& | [Object](../object/) 要转换。 |

### ReturnValue

转换结果。若无可用转换则返回 nullptr。

## 另见

* Typedef [Exception](../exception/)
* Namespace [System](../)
* Library [Aspose.Page for C++](../../)
## System::AsCast(const Source\&) method


使用 'as' 运算符将源类型转换为结果类型。用于将对象转换为异常。

```cpp
template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::ObjectToException, Result> System::AsCast(const Source &value)
```


| Parameter | 描述 |
| --- | --- |
| 源 | 源类型。 |
| Result | 结果类型。 |

| Parameter | Type | 描述 |
| --- | --- | --- |
| value | const Source\& | [Object](../object/) 要转换。 |

### ReturnValue

转换结果。若无可用转换则返回 nullptr。

## 另见

* Namespace [System](../)
* Library [Aspose.Page for C++](../../)
## System::AsCast(const Source\&) method


使用 'as' 运算符将源类型转换为结果类型。用于源和结果都是智能指针的情况。

```cpp
template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Pointer, typename CastResult<Result>::type> System::AsCast(const Source &value)
```


| Parameter | 描述 |
| --- | --- |
| 源 | 源类型。 |
| Result | 结果类型。 |

| Parameter | Type | 描述 |
| --- | --- | --- |
| value | const Source\& | [Object](../object/) 要转换。 |

### ReturnValue

转换结果。若无可用转换则返回 nullptr。

## 另见

* Namespace [System](../)
* Library [Aspose.Page for C++](../../)
## System::AsCast(const Source\&) method


使用 'as' 运算符将源类型转换为结果类型。用于源和结果都是智能指针（在结果类型中显式使用 [SmartPtr<...>](../smartptr/)）。

```cpp
template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::PointerToPointer, Result> System::AsCast(const Source &value)
```


| Parameter | 描述 |
| --- | --- |
| 源 | 源类型。 |
| Result | 结果类型。 |

| Parameter | Type | 描述 |
| --- | --- | --- |
| value | const Source\& | [Object](../object/) 要转换。 |

### ReturnValue

转换结果。若无可用转换则返回 nullptr。

## 另见

* Namespace [System](../)
* Library [Aspose.Page for C++](../../)
## System::AsCast(const Source\&) method


使用 'as' 运算符将源类型转换为结果类型。用于将对象解箱为可空类型。

```cpp
template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::UnboxingToNullable, Result> System::AsCast(const Source &value)
```


| Parameter | 描述 |
| --- | --- |
| 源 | 源类型。 |
| Result | 结果类型。 |

| Parameter | Type | 描述 |
| --- | --- | --- |
| value | const Source\& | [Object](../object/) 要转换。 |

### ReturnValue

转换结果。若无可用转换则返回空的可空值。

## 另见

* Namespace [System](../)
* Library [Aspose.Page for C++](../../)
## System::AsCast(const Source\&) method


使用 'as' 运算符将源类型转换为结果类型。无效的解箱到非对象类型。

```cpp
template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::InterfaceUnboxingToNullable, Result> System::AsCast(const Source &value)
```


| Parameter | 描述 |
| --- | --- |
| 源 | 源类型。 |
| Result | 结果类型。 |

| Parameter | Type | 描述 |
| --- | --- | --- |
| value | const Source\& | [Object](../object/) 要转换。 |

### ReturnValue

始终返回 null。

## 另见

* Namespace [System](../)
* Library [Aspose.Page for C++](../../)
## System::AsCast(const Source\&) method


无效的解箱到非对象类型。

```cpp
template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::InvalidUnboxing, Result> System::AsCast(const Source &value)
```


| Parameter | 描述 |
| --- | --- |
| 源 | 源类型。 |
| Result | 结果类型。 |

| Parameter | Type | 描述 |
| --- | --- | --- |
| value | const Source\& | [Object](../object/) 要转换。 |

### ReturnValue

始终返回 null。

## 另见

* Namespace [System](../)
* Library [Aspose.Page for C++](../../)
## System::AsCast(const Source\&) method


使用 'as' 运算符将源类型转换为结果类型。用于将可空对象装箱。

```cpp
template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::NullableBoxing, Result> System::AsCast(const Source &value)
```


| Parameter | 描述 |
| --- | --- |
| 源 | 源类型。 |
| Result | 结果类型。 |

| Parameter | Type | 描述 |
| --- | --- | --- |
| value | const Source\& | [Object](../object/) 要转换。 |

### ReturnValue

转换结果。

## 另见

* Namespace [System](../)
* Library [Aspose.Page for C++](../../)
## System::AsCast(const Source\&) method


使用 'as' 运算符将源类型转换为结果类型。用于将普通对象装箱。

```cpp
template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::InterfaceBoxing, typename CastResult<Result>::type> System::AsCast(const Source &value)
```


| Parameter | 描述 |
| --- | --- |
| 源 | 源类型。 |
| Result | 结果类型。 |

| Parameter | Type | 描述 |
| --- | --- | --- |
| value | const Source\& | [Object](../object/) 要转换。 |

### ReturnValue

转换结果。

## 另见

* Namespace [System](../)
* Library [Aspose.Page for C++](../../)
## System::AsCast(const Source\&) method


使用 'as' 运算符将源类型转换为结果类型。用于将普通对象装箱。

```cpp
template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Boxing, typename CastResult<Result>::type> System::AsCast(const Source &value)
```


| Parameter | 描述 |
| --- | --- |
| 源 | 源类型。 |
| Result | 结果类型。 |

| Parameter | Type | 描述 |
| --- | --- | --- |
| value | const Source\& | [Object](../object/) 要转换。 |

### ReturnValue

转换结果。

## 另见

* Namespace [System](../)
* Library [Aspose.Page for C++](../../)
## System::AsCast(const Source\&) method


使用 'as' 运算符将源类型转换为结果类型。用于字符串解箱。

```cpp
template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::UnboxingToString, Result> System::AsCast(const Source &value)
```


| Parameter | 描述 |
| --- | --- |
| 源 | 源类型。 |
| Result | 结果类型。 |

| Parameter | Type | 描述 |
| --- | --- | --- |
| value | const Source\& | [Object](../object/) 要转换。 |

### ReturnValue

转换结果。

## 另见

* Namespace [System](../)
* Library [Aspose.Page for C++](../../)
## System::AsCast(const Source\&) method


使用 'as' 运算符将源类型转换为结果类型。用于 nullptr 情况。

```cpp
template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Null, typename CastResult<Result>::type> System::AsCast(const Source &value)
```


| Parameter | 描述 |
| --- | --- |
| 源 | 源类型。 |
| Result | 结果类型。 |

| Parameter | Type | 描述 |
| --- | --- | --- |
| value | const Source\& | [Object](../object/) 要转换。 |

### ReturnValue

转换结果。

## 另见

* Namespace [System](../)
* Library [Aspose.Page for C++](../../)
## System::AsCast(const Source\&) method


使用 'as' 运算符将源类型转换为结果类型。用于在数组之间进行转换。

```cpp
template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Array, typename CastResult<Result>::type> System::AsCast(const Source &value)
```


| Parameter | 描述 |
| --- | --- |
| 源 | 源类型。 |
| Result | 结果类型。 |

| Parameter | Type | 描述 |
| --- | --- | --- |
| value | const Source\& | [Object](../object/) 要转换。 |

### ReturnValue

转换结果。若任何数组成员都没有可用转换则返回 nullptr。

## 另见

* Namespace [System](../)
* Library [Aspose.Page for C++](../../)
