Struct ReadOnlyLocalReference<T>
Represents read-only typed reference.
Inherited Members
Namespace: DotNext
Assembly: DotNext.dll
Syntax
public readonly ref struct ReadOnlyLocalReference<T> : ITypedReference<T>, IEquatable<ReadOnlyLocalReference<T>> where T : allows ref struct
Type Parameters
| Name | Description |
|---|---|
| T | The type of the referenced value. |
Constructors
View SourceReadOnlyLocalReference(ref readonly T)
Represents read-only typed reference.
Declaration
public ReadOnlyLocalReference(ref readonly T location)
Parameters
| Type | Name | Description |
|---|---|---|
| T | location | The location of the value. |
Properties
View SourceIsEmpty
Gets a value indicating that this reference is empty.
Declaration
public bool IsEmpty { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Value
The referenced value.
Declaration
public ref readonly T Value { get; }
Property Value
| Type | Description |
|---|---|
| T |
Methods
View SourceEquals(ReadOnlyLocalReference<T>)
Declaration
public bool Equals(ReadOnlyLocalReference<T> other)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlyLocalReference<T> | other |
Returns
| Type | Description |
|---|---|
| bool |
Operators
View Sourceoperator ==(ReadOnlyLocalReference<T>, ReadOnlyLocalReference<T>)
Checks whether the two references point to the same memory location.
Declaration
public static bool operator ==(ReadOnlyLocalReference<T> x, ReadOnlyLocalReference<T> y)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlyLocalReference<T> | x | The first reference to compare. |
| ReadOnlyLocalReference<T> | y | The second reference to compare. |
Returns
| Type | Description |
|---|---|
| bool | true if both references point to the same memory location; otherwise, false. |
implicit operator Variant(ReadOnlyLocalReference<T>)
Converts typed local reference to the variant value.
Declaration
public static implicit operator Variant(ReadOnlyLocalReference<T> reference)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlyLocalReference<T> | reference | The reference to convert. |
Returns
| Type | Description |
|---|---|
| Variant | The variant immutable value. |
operator !=(ReadOnlyLocalReference<T>, ReadOnlyLocalReference<T>)
Checks whether the two references point to the different memory locations.
Declaration
public static bool operator !=(ReadOnlyLocalReference<T> x, ReadOnlyLocalReference<T> y)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlyLocalReference<T> | x | The first reference to compare. |
| ReadOnlyLocalReference<T> | y | The second reference to compare. |
Returns
| Type | Description |
|---|---|
| bool | true if both references point to the different memory locations; otherwise, false. |