CastArray3DTFrom, TToGetElementReferenceUnsafe Method
Gets the reference to the element at the specified coordinates without any range check or validation.
This method can even throw a
NullReferenceException if the
IsNull property returns
.
To validate the coordinates against
Length use
the
GetElementReference method instead.
Parameter order is the same as in case of a regular three-dimensional array.
Namespace: KGySoft.CollectionsAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.5.0
[SecurityCriticalAttribute]
public ref TTo GetElementReferenceUnsafe(
int z,
int y,
int x
)
<SecurityCriticalAttribute>
Public Function GetElementReferenceUnsafe (
z As Integer,
y As Integer,
x As Integer
) As TTo
public:
[SecurityCriticalAttribute]
TTo% GetElementReferenceUnsafe(
int z,
int y,
int x
)
[<SecurityCriticalAttribute>]
member GetElementReferenceUnsafe :
z : int *
y : int *
x : int -> 'TTo
- z Int32
- The Z-coordinate (depth index) of the item to get the reference for.
- y Int32
- The Y-coordinate (row index) of the item to get the reference for.
- x Int32
- The X-coordinate (column index) of the item to get the reference for.
TToThe reference to the element at the specified coordinates.
You must ensure that the specified indices designate an element in the bounds
of the actual underlying array. Attempting to access protected memory may crash the runtime.
Also, if
TTo is a primitive type of size larger than 1 byte, and the executing architecture does not support misaligned memory access,
a
DataMisalignedException can be thrown in the moment of dereferencing the result if its address is not properly aligned.
This method returns a value by reference. If this library is used by an older compiler that does not support such members,
use the
GetElementUnsafe/
SetElementUnsafe methods instead.