Struct ReadOnlyList<T>
- Namespace
- Jitter2.DataStructures
- Assembly
- Jitter2.dll
A read-only wrapper around List<T> that prevents modification while allowing indexed access and enumeration.
public readonly struct ReadOnlyList<T> : IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
TThe type of elements in the list.
- Implements
-
IEnumerable<T>
- Inherited Members
Constructors
ReadOnlyList(List<T>)
A read-only wrapper around List<T> that prevents modification while allowing indexed access and enumeration.
public ReadOnlyList(List<T> list)
Parameters
listList<T>
Properties
Count
Gets the number of elements in the list.
public int Count { get; }
Property Value
this[int]
Gets the element at the specified index.
public T this[int i] { get; }
Parameters
iint
Property Value
- T
Methods
GetEnumerator()
public List<T>.Enumerator GetEnumerator()
Returns
- List<T>.Enumerator