Struct BlittableRef<T>
Represents a pointer to an unmanaged value.
public readonly struct BlittableRef<T> where T : unmanaged
Type Parameters
Tthe type of the unmanaged value.
- Inherited Members
Constructors
BlittableRef(nint)
Initializes a new instance of the BlittableRef<T> struct.
public BlittableRef(nint ptr)
Parameters
ptrnintThe pointer value.
Properties
HasValue
Gets a value indicating whether the pointer has a value (is not a null pointer).
public bool HasValue { get; }
Property Value
Value
Gets a reference to the value this pointer points to.
public ref T Value { get; }
Property Value
- T
Methods
GetValueOrDefault()
Gets the value this pointer points to or the default value of T if the pointer is null.
public T GetValueOrDefault()
Returns
- T
The value this pointer points to or the default value of
Tif the pointer is null.
GetValueOrDefault(T)
Gets the value this pointer points to or the specified defaultValue if the pointer is null.
public T GetValueOrDefault(T defaultValue)
Parameters
defaultValueTThe default value to return if the pointer is null.
Returns
- T
The value this pointer points to or the default value if the pointer is null.