Mercurial > projects > dwt-addons
diff dwtx/dwtxhelper/Collection.d @ 172:d994a8b2cdf7
again compile fixes
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 10 Sep 2008 23:14:02 +0200 |
parents | ee33f30b14e2 |
children | c6d7b1ea700b |
line wrap: on
line diff
--- a/dwtx/dwtxhelper/Collection.d Wed Sep 10 22:45:07 2008 +0200 +++ b/dwtx/dwtxhelper/Collection.d Wed Sep 10 23:14:02 2008 +0200 @@ -2151,14 +2151,15 @@ } +/ static void sort( T )( T[] a, Comparator c ){ - bool isLess( T o1, T o2 ){ - return c.compare( cast(Object)o1, cast(Object)o2 ) < 0; + static if( is( T : char[] )){ + bool isLess( String o1, String o2 ){ + return c.compare( stringcast(o1), stringcast(o2) ) < 0; + } } - tango.core.Array.sort( a, &isLess ); - } - static void sort( T : String )( String[] a, Comparator c ){ - bool isLess( String o1, String o2 ){ - return c.compare( stringcast(o1), stringcast(o2) ) < 0; + else{ + bool isLess( T o1, T o2 ){ + return c.compare( cast(Object)o1, cast(Object)o2 ) < 0; + } } tango.core.Array.sort( a, &isLess ); }