- 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
比较两个值的大小,其中一个是否“大于,小于或等于”另一个值。
这个版本比较两个bool 值。
int Compare(
|
这个版本比较两个char值。
int Compare(
|
这个版本比较两个uchar值。
int Compare(
|
这个版本比较两个short值。
int Compare(
|
这个版本比较两个ushort值。
int Compare(
|
这个版本比较两个color 值。
int Compare(
|
这个版本比较两个int 值。
int Compare(
|
这个版本比较两个uint值。
int Compare(
|
这个版本比较两个datetime值。
int Compare(
|
这个版本比较两个long值。
int Compare(
|
这个版本比较两个ulong值。
int Compare(
|
这个版本比较两个float值。
int Compare(
|
这个版本比较两个double值。
int Compare(
|
这个版本比较两个string值。
int Compare(
|
这个版本比较两个其他类型的值。
template<typename T>
|
参数
x
[in] 第一个值
y
[in] 第二个值
返回值
返回表示相比较的两个值比率的数字:
- 如果结果小于0,x则小于y(x<y)
- 如果结果等于0,x则等于y(x=y)
- 如果结果大于0,x则大于y(x>y)
注意
如果T类型是实施 IComparable<T>接口的对象,那么这些对象将根据其比较方法进行比较。在所有其他情况下,都返回0 。