Mercurial > projects > orange
comparison orange/util/CTFE.d @ 35:511d1ef4e299 experimental
Now all unit tests pass on latest DMD2 compiler.
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Wed, 03 Aug 2011 21:44:11 +0200 |
parents | 78e5fef4bbf2 |
children |
comparison
equal
deleted
inserted
replaced
34:068e853b9c07 | 35:511d1ef4e299 |
---|---|
99 * | 99 * |
100 * Returns: true if the array contains the element, otherwise false | 100 * Returns: true if the array contains the element, otherwise false |
101 */ | 101 */ |
102 bool contains (T) (T[] arr, T element) | 102 bool contains (T) (T[] arr, T element) |
103 { | 103 { |
104 return arr.indexOf(element) != size_t.max; | 104 return indexOf(arr, element) != size_t.max; |
105 } | 105 } |
106 | 106 |
107 /** | 107 /** |
108 * CTFE, splits the given string on the given pattern | 108 * CTFE, splits the given string on the given pattern |
109 * | 109 * |