Class ReadOnlyList<T>
Wraps a List<T> to provide a read-only view of its memory without copying any elements.
It is preferable to use this collection in API designs instead of IReadOnlyCollection
because
GetEnumerator() returns a value-type enumerator and does not perform any heap allocations.
Inherited Members
Namespace: Unity.XR.CoreUtils.Collections
Assembly: solution.dll
Syntax
public class ReadOnlyList<T> : IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
Name | Description |
---|---|
T | The element type. |
Remarks
This collection is not thread-safe.
Constructors
Name | Description |
---|---|
ReadOnlyList(List<T>) | Constructs a new instance of this class that is a read-only wrapper around the specified list. |
Properties
Name | Description |
---|---|
Count | The number of elements in the list. |
this[int] | Returns the element at |
Methods
Name | Description |
---|---|
GetEnumerator() | Returns an enumerator that iterates through the list. |