src/cx/iterator.h

changeset 852
16e2a3391e88
parent 851
adb4e0737c33
child 853
d4baf4dd55c3
equal deleted inserted replaced
851:adb4e0737c33 852:16e2a3391e88
272 #define cx_foreach(type, elem, iter) \ 272 #define cx_foreach(type, elem, iter) \
273 for (type elem; cxIteratorValid(iter) && (elem = (type)cxIteratorCurrent(iter)) != NULL ; cxIteratorNext(iter)) 273 for (type elem; cxIteratorValid(iter) && (elem = (type)cxIteratorCurrent(iter)) != NULL ; cxIteratorNext(iter))
274 274
275 275
276 /** 276 /**
277 * Creates a mutating iterator for the specified plain array. 277 * Creates an iterator for the specified plain array.
278 * 278 *
279 * The \p array can be \c NULL in which case the iterator will be immediately 279 * The \p array can be \c NULL in which case the iterator will be immediately
280 * initialized such that #cxIteratorValid() returns \c false. 280 * initialized such that #cxIteratorValid() returns \c false.
281 * 281 *
282 * 282 *
291 size_t elem_size, 291 size_t elem_size,
292 size_t elem_count 292 size_t elem_count
293 ); 293 );
294 294
295 /** 295 /**
296 * Creates an iterator for the specified plain array. 296 * Creates a mutating iterator for the specified plain array.
297 * 297 *
298 * While the iterator is in use, the array may only be altered by removing 298 * While the iterator is in use, the array may only be altered by removing
299 * elements through #cxIteratorFlagRemoval(). Every other change to the array 299 * elements through #cxIteratorFlagRemoval(). Every other change to the array
300 * will bring this iterator to an undefined state. 300 * will bring this iterator to an undefined state.
301 * 301 *

mercurial