docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Struct InplaceArray<T>

    An array-like object that stores up to four elements. This is a value type that does not allocate any additional memory.

    Implements
    IEquatable<InplaceArray<T>>
    Inherited Members
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.MLAgents
    Assembly: solution.dll
    Syntax
    public struct InplaceArray<T> : IEquatable<InplaceArray<T>> where T : struct
    Type Parameters
    Name Description
    T
    Remarks

    This does not implement any interfaces such as IList, in order to avoid any accidental boxing allocations.

    Constructors

    Name Description
    InplaceArray(T)

    Create a length-1 array.

    InplaceArray(T, T)

    Create a length-2 array.

    InplaceArray(T, T, T)

    Create a length-3 array.

    InplaceArray(T, T, T, T)

    Create a length-3 array.

    Properties

    Name Description
    this[int]

    Per-element access.

    Length

    The length of the array.

    Methods

    Name Description
    Equals(object)

    Check that the arrays are equivalent.

    Equals(InplaceArray<T>)

    Check that the arrays are equivalent.

    FromList(IList<T>)

    Construct an InplaceArray from an IList (e.g. Array or List). The source must be non-empty and have at most 4 elements.

    GetHashCode()

    Get a hashcode for the array.

    ToString()

    Returns a string representation of the array's elements.

    Operators

    Name Description
    operator ==(InplaceArray<T>, InplaceArray<T>)

    Check that the arrays have the same length and have all equal values.

    operator !=(InplaceArray<T>, InplaceArray<T>)

    Check that the arrays are not equivalent.

    In This Article
    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