- ICollection<T>
- IEqualityComparable<T>
- IComparable<T>
- IComparer<T>
- IEqualityComparer<T>
- IList<T>
- IMap<TKey,TValue>
- ISet<T>
- CDefaultComparer<T>
- CDefaultEqualityComparer<T>
- CRedBlackTreeNode<T>
- CLinkedListNode<T>
- CKeyValuePair<TKey,TValue>
- CArrayList<T>
- CHashMap<TKey,TValue>
- CHashSet<T>
- CLinkedList<T>
- CQueue<T>
- CRedBlackTree<T>
- CSortedMap<TKey, TValue>
- CSortedSet<T>
- CStack<T>
- ArrayBinarySearch<T>
- ArrayIndexOf<T>
- ArrayLastIndexOf<T>
- ArrayReverse<T>
- Compare
- Equals<T>
- GetHashCode
Compare
Compares the two values, whether one of them is "greater than, less than or equal to" the other one.
A version for comparing two bool values.
int Compare(
|
A version for comparing two char values.
int Compare(
|
A version for comparing two uchar values.
int Compare(
|
A version for comparing two short values.
int Compare(
|
A version for comparing two ushort values.
int Compare(
|
A version for comparing two color values.
int Compare(
|
A version for comparing two int values.
int Compare(
|
A version for comparing two uint values.
int Compare(
|
A version for comparing two datetime values.
int Compare(
|
A version for comparing two long values.
int Compare(
|
A version for comparing two ulong values.
int Compare(
|
A version for comparing two float values.
int Compare(
|
A version for comparing two double values.
int Compare(
|
A version for comparing two string values.
int Compare(
|
A version for comparing two values of other types.
template<typename T>
|
Parameters
x
[in] The first value
y
[in] The second value
Return Value
Returns a number that expresses the ratio of the two compared values:
- if the result is less than zero, x is less than y (x<y)
- if the result is equal to zero, x is equal to y (x=y)
- if the result is greater than zero, x is greater than y (x>y)
Note
If the T type is an object that implements the IComparable<T> interface, then the objects will be compared based on its Compare method. In all other cases, 0 is returned.