System.Comparison<T> Delegate

public delegate int Comparison<T>(T x, T y);

Base Types

Object
  Delegate
    Comparison<T>

This type implements ICloneable.

Assembly

mscorlib

Library

BCL

Summary

Represents the method that compares two objects of the same type.

Parameters

x
The first object to compare.
y
The second object to compare.

Return Value

A Int32 containing a value that reflects the sort order of the objects.

ValueCondition
Less than zerox is less than y.
Zero x equals y.
Greater than zerox is greater than y.

Description

[Note: This delegate is used by the method System.Array.Sort(T[], Comparison<T>)(T[], Comparison<T>) , and in System.Collections.Generic.List<T> to sort the elements of the collection.

]

See Also

System Namespace