Show / Hide Table of Contents

Struct LocalReference<T>

Represents a typed reference that can be passed as a generic argument.

Implements
ITypedReference<T>
IEquatable<LocalReference<T>>
Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
ValueType.ToString()
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: DotNext
Assembly: DotNext.dll
Syntax
public readonly ref struct LocalReference<T> : ITypedReference<T>, IEquatable<LocalReference<T>> where T : allows ref struct
Type Parameters
Name Description
T

The type of the referenced value.

Constructors

View Source

LocalReference(ref T)

Represents a typed reference that can be passed as a generic argument.

Declaration
public LocalReference(ref T location)
Parameters
Type Name Description
T location

The location of the value.

Properties

View Source

IsEmpty

Gets a value indicating that this reference is empty.

Declaration
public bool IsEmpty { get; }
Property Value
Type Description
bool
View Source

Value

The referenced value.

Declaration
public ref T Value { get; }
Property Value
Type Description
T

Methods

View Source

Equals(LocalReference<T>)

Declaration
public bool Equals(LocalReference<T> other)
Parameters
Type Name Description
LocalReference<T> other
Returns
Type Description
bool

Operators

View Source

operator ==(LocalReference<T>, LocalReference<T>)

Checks whether the two references point to the same memory location.

Declaration
public static bool operator ==(LocalReference<T> x, LocalReference<T> y)
Parameters
Type Name Description
LocalReference<T> x

The first reference to compare.

LocalReference<T> y

The second reference to compare.

Returns
Type Description
bool

true if both references point to the same memory location; otherwise, false.

View Source

implicit operator ReadOnlyLocalReference<T>(LocalReference<T>)

Converts mutable typed reference to the read-only typed reference.

Declaration
public static implicit operator ReadOnlyLocalReference<T>(LocalReference<T> reference)
Parameters
Type Name Description
LocalReference<T> reference

The reference to convert.

Returns
Type Description
ReadOnlyLocalReference<T>

Read-only view of the same memory location as presented by reference.

View Source

implicit operator Variant(LocalReference<T>)

Converts typed local reference to the variant value.

Declaration
public static implicit operator Variant(LocalReference<T> reference)
Parameters
Type Name Description
LocalReference<T> reference

The reference to convert.

Returns
Type Description
Variant

The variant mutable value.

View Source

operator !=(LocalReference<T>, LocalReference<T>)

Checks whether the two references point to the different memory locations.

Declaration
public static bool operator !=(LocalReference<T> x, LocalReference<T> y)
Parameters
Type Name Description
LocalReference<T> x

The first reference to compare.

LocalReference<T> y

The second reference to compare.

Returns
Type Description
bool

true if both references point to the different memory locations; otherwise, false.

Implements

ITypedReference<T>
IEquatable<T>

Extension Methods

BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
Enumerator.Skip<TEnumerator, T>(ref TEnumerator, int)
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾