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
-
IReadOnlyRef<T>IEnumerable<T>
- Inherited Members
- Extension Methods
Constructors
Ref(T)
Creates a new Ref<T> instance.
public Ref(T value)
Parameters
value
TUnderlying 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
intThe 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
TObject to convert.
Returns
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
.