## MemoryMarshal::Cast method


Casts a [Span](../../../system/span/) of one primitive type TFrom to another primitive type TTo.

```cpp
template<typename TFrom,typename TTo> static Span<TTo> System::Runtime::InteropServices::MemoryMarshal::Cast(const Span<TFrom> &span)
```


| Parameter | Description |
| --- | --- |
| TFrom | The source type of the span. |
| TTo | The target type of the span. |

| Parameter | Type | Description |
| --- | --- | --- |
| span | const Span\<TFrom\>\& | The span to cast. |

### ReturnValue

A span of the target type.

## See Also

* Class [Span](../../../system/span/)
* Class [MemoryMarshal](../)
* Namespace [System::Runtime::InteropServices](../../)
* Library [Aspose.PDF for C++](../../../)
