diff -r b2bc48c2b251 -r adb4e0737c33 src/cx/iterator.h --- a/src/cx/iterator.h Thu May 23 15:05:24 2024 +0200 +++ b/src/cx/iterator.h Thu May 23 18:21:08 2024 +0200 @@ -274,6 +274,25 @@ /** + * Creates a mutating iterator for the specified plain array. + * + * The \p array can be \c NULL in which case the iterator will be immediately + * initialized such that #cxIteratorValid() returns \c false. + * + * + * @param array a pointer to the array (can be \c NULL) + * @param elem_size the size of one array element + * @param elem_count the number of elements in the array + * @return an iterator for the specified array + */ +__attribute__((__warn_unused_result__)) +CxIterator cxIterator( + void const *array, + size_t elem_size, + size_t elem_count +); + +/** * Creates an iterator for the specified plain array. * * While the iterator is in use, the array may only be altered by removing @@ -297,7 +316,7 @@ * @return an iterator for the specified array */ __attribute__((__warn_unused_result__)) -CxMutIterator cxIterator( // TODO: unify the iterator types +CxMutIterator cxMutIterator( void *array, size_t elem_size, size_t elem_count,