CastArrayTFrom, TToCastT Method

Reinterprets the TTo type of this CastArrayTFrom, TTo to type T.

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public CastArray<TFrom, T> Cast<T>()
where T : struct, new()

Type Parameters

T
The new desired type instead of the original TTo.

Return Value

CastArrayTFrom, T
A CastArrayTFrom, TTo instance where original TTo type is replaced to T.

Remarks

If the size of T cannot be divided by the size of TFrom, then the cast result may not cover the whole original Buffer to prevent exceeding beyond the original bounds.

See Also