docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct NativeSortExtension.DefaultComparer<T>

    A comparer that uses IComparable.CompareTo(). For primitive types, this is an ascending sort.

    Namespace: Unity.Collections
    Assembly: Unity.Collections.dll
    Syntax
    public struct NativeSortExtension.DefaultComparer<T> where T : IComparable<T>
    Type Parameters
    Name Description
    T

    Source type of elements

    Methods

    Compare(T, T)

    Compares two values.

    Declaration
    public int Compare(T x, T y)
    Parameters
    Type Name Description
    T x

    First value to compare.

    T y

    Second value to compare.

    Returns
    Type Description
    int

    A signed integer that denotes the relative values of x and y: 0 if they're equal, negative if x < y, and positive if x > y.

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