Class UnsafeListExtensions | Collections | 0.15.0-preview.21
docs.unity3d.com
    Show / Hide Table of Contents

    Class UnsafeListExtensions

    UnsafeList extension methods.

    Inheritance
    Object
    UnsafeListExtensions
    Namespace: Unity.Collections.LowLevel.Unsafe
    Syntax
    public static class UnsafeListExtensions

    Methods

    Contains<T, U>(UnsafeList<T>, U)

    Determines whether an element is in the container.

    Declaration
    public static bool Contains<T, U>(this UnsafeList<T> list, U value)
        where T : struct, IEquatable<U>
    Parameters
    Type Name Description
    UnsafeList<T> list

    The container to locate value.

    U value

    The value to locate.

    Returns
    Type Description
    Boolean

    True, if element is found.

    Type Parameters
    Name Description
    T

    The type of values in the container.

    U

    The value type.

    Contains<T, U>(UnsafeList<T>.ParallelReader, U)

    Determines whether an element is in the container.

    Declaration
    public static bool Contains<T, U>(this UnsafeList<T>.ParallelReader list, U value)
        where T : struct, IEquatable<U>
    Parameters
    Type Name Description
    UnsafeList.ParallelReader<> list

    The container to locate value.

    U value

    The value to locate.

    Returns
    Type Description
    Boolean

    True, if element is found.

    Type Parameters
    Name Description
    T

    The type of values in the container.

    U

    The value type.

    IndexOf<T, U>(UnsafeList<T>, U)

    Searches for the specified element in the container.

    Declaration
    public static int IndexOf<T, U>(this UnsafeList<T> list, U value)
        where T : struct, IEquatable<U>
    Parameters
    Type Name Description
    UnsafeList<T> list

    The container to locate value.

    U value

    The value to locate.

    Returns
    Type Description
    Int32

    The zero-based index of the first occurrence element if found, otherwise returns -1.

    Type Parameters
    Name Description
    T

    The type of values in the container.

    U

    The value type.

    IndexOf<T, U>(UnsafeList<T>.ParallelReader, U)

    Searches for the specified element in the container.

    Declaration
    public static int IndexOf<T, U>(this UnsafeList<T>.ParallelReader list, U value)
        where T : struct, IEquatable<U>
    Parameters
    Type Name Description
    UnsafeList.ParallelReader<> list

    The container to locate value.

    U value

    The value to locate.

    Returns
    Type Description
    Int32

    The zero-based index of the first occurrence element if found, otherwise returns -1.

    Type Parameters
    Name Description
    T

    The type of values in the container.

    U

    The value type.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023