摘要:
public class Person { //当 lhs> rhs的时候,就进行交换位置public void SwapIfGreater<T>( ref T lhs, ref T rhs ) where T : System.IComparable<T> { T temp; if ( lhs.CompareTo( rhs ) > 0 ) { temp = lhs; lhs = rhs; rhs = temp; } } }class Program { static void Main( string[ ] args ) { Person p = new 阅读全文