225 ) { |
234 ) { |
226 return list->cl->at(list, index); |
235 return list->cl->at(list, index); |
227 } |
236 } |
228 |
237 |
229 /** |
238 /** |
|
239 * Returns an iterator pointing to the item at the specified index. |
|
240 * |
|
241 * The returned iterator is position-aware. |
|
242 * |
|
243 * If the index is out of range, a past-the-end iterator will be returned. |
|
244 * |
|
245 * @param list the list |
|
246 * @param index the index where the iterator shall point at |
|
247 * @return a new iterator |
|
248 */ |
|
249 static inline CxIterator cxListIterator( |
|
250 CxList list, |
|
251 size_t index |
|
252 ) { |
|
253 return list->cl->iterator(list, index); |
|
254 } |
|
255 |
|
256 /** |
|
257 * Returns an iterator pointing to the first item of the list. |
|
258 * |
|
259 * The returned iterator is position-aware. |
|
260 * |
|
261 * If the list is empty, a past-the-end iterator will be returned. |
|
262 * |
|
263 * @param list the list |
|
264 * @return a new iterator |
|
265 */ |
|
266 static inline CxIterator cxListBegin(CxList list) { |
|
267 return list->cl->iterator(list, 0); |
|
268 } |
|
269 |
|
270 /** |
230 * Returns the index of the first element that equals \p elem. |
271 * Returns the index of the first element that equals \p elem. |
231 * |
272 * |
232 * Determining equality is performed by the list's comparator function. |
273 * Determining equality is performed by the list's comparator function. |
233 * |
274 * |
234 * @param list the list |
275 * @param list the list |