CastArray2DTFrom, TToItem(Index) Property

Gets a row of the CastArray2DTFrom, TTo as a CastArrayTFrom, TTo instance. Please note that the size of TTo multiplied by Width must be divisible by the size of TFrom.

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public CastArray<TFrom, TTo> this[
	Index y
] { get; }

Parameters

y  Index
The index of the row to obtain.

Return Value

CastArrayTFrom, TTo
A CastArrayTFrom, TTo instance that represents a row of this CastArray2DTFrom, TTo instance.

Remarks

  Note

  • If the size of TTo multiplied by Width is not divisible by the size of TFrom, then this property throws an ArgumentException. If the targeted platform supports the SpanT type and misaligned memory access, then you can try to use the AsSpan property and the MemoryMarshal.Cast method.
  • This member is available in .NET Core 3.0/.NET Standard 2.1 and above.

Exceptions

ArgumentOutOfRangeExceptiony is out of range.
ArgumentExceptionThe size of TTo multiplied by Width is not divisible by the size of TFrom.

See Also