Mercurial > projects > dwt-mac
comparison dwt/dwthelper/array.d @ 122:2e671fa40eec
Ported dwt.dnd, dwt.opengl, dwt.printing and dwt.program
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Wed, 31 Dec 2008 21:01:13 +0100 |
parents | d32621bf0f90 |
children | 63a09873578e |
comparison
equal
deleted
inserted
replaced
121:e1c48e37e0f5 | 122:2e671fa40eec |
---|---|
60 * Returns: the element at the specified index | 60 * Returns: the element at the specified index |
61 * | 61 * |
62 * Throws: AssertException if the length of the array is 0 | 62 * Throws: AssertException if the length of the array is 0 |
63 * AssertException if the $(D_CODE index) is greater than the length of the array | 63 * AssertException if the $(D_CODE index) is greater than the length of the array |
64 */ | 64 */ |
65 T elementAt (T) (T[] arr, size_t index) | 65 T elementAt (T) (T[] arr, int index) |
66 in | 66 in |
67 { | 67 { |
68 assert(arr.length > 0); | 68 assert(arr.length > 0); |
69 assert(index < arr.length); | 69 assert(index > -1 && index < arr.length); |
70 } | 70 } |
71 body | 71 body |
72 { | 72 { |
73 return arr[index]; | 73 return arr[index]; |
74 } | 74 } |