Table of Contents

Class Ref<T>

Namespace
LfrlAnvil
Assembly
LfrlAnvil.Core.dll

Represents a generic boxed value.

public sealed class Ref<T> : IReadOnlyRef<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable

Type Parameters

T

Value type.

Inheritance
Ref<T>
Implements
Inherited Members
Extension Methods

Constructors

Ref(T)

Creates a new Ref<T> instance.

public Ref(T value)

Parameters

value T

Underlying value.

Properties

Count

Gets the number of elements in the collection.

public int Count { get; }

Property Value

int

The number of elements in the collection.

this[int]

Gets the element at the specified index in the read-only list.

public T this[int index] { get; }

Parameters

index int

The zero-based index of the element to get.

Property Value

T

The element at the specified index in the read-only list.

Value

Underlying value.

public T Value { get; set; }

Property Value

T

Methods

GetEnumerator()

Creates a new Ref<T>.Enumerator instance for this ref.

[Pure]
public Ref<T>.Enumerator GetEnumerator()

Returns

Ref<T>.Enumerator

New Ref<T>.Enumerator instance.

ToString()

Returns a string representation of this Ref<T> instance.

[Pure]
public override string ToString()

Returns

string

String representation.

Operators

explicit operator Ref<T>(T)

Converts provided value to Ref<T>.

[Pure]
public static explicit operator Ref<T>(T value)

Parameters

value T

Object to convert.

Returns

Ref<T>

New Ref<T> instance.

implicit operator T(Ref<T>)

Converts provided obj to the underlying value type.

[Pure]
public static implicit operator T(Ref<T> obj)

Parameters

obj Ref<T>

Object to convert.

Returns

T

Value from the obj.