docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    ReadOnlyList<T>
    Implements
    IReadOnlyList<T>
    IReadOnlyCollection<T>
    IEnumerable<T>
    IEnumerable
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    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 index.

    Methods

    Name Description
    GetEnumerator()

    Returns an enumerator that iterates through the list.

    In This Article
    • Constructors
    • Properties
    • Methods
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)