src/cx/iterator.h

changeset 851
adb4e0737c33
parent 850
b2bc48c2b251
child 852
16e2a3391e88
     1.1 --- a/src/cx/iterator.h	Thu May 23 15:05:24 2024 +0200
     1.2 +++ b/src/cx/iterator.h	Thu May 23 18:21:08 2024 +0200
     1.3 @@ -274,6 +274,25 @@
     1.4  
     1.5  
     1.6  /**
     1.7 + * Creates a mutating iterator for the specified plain array.
     1.8 + *
     1.9 + * The \p array can be \c NULL in which case the iterator will be immediately
    1.10 + * initialized such that #cxIteratorValid() returns \c false.
    1.11 + *
    1.12 + *
    1.13 + * @param array a pointer to the array (can be \c NULL)
    1.14 + * @param elem_size the size of one array element
    1.15 + * @param elem_count the number of elements in the array
    1.16 + * @return an iterator for the specified array
    1.17 + */
    1.18 +__attribute__((__warn_unused_result__))
    1.19 +CxIterator cxIterator(
    1.20 +        void const *array,
    1.21 +        size_t elem_size,
    1.22 +        size_t elem_count
    1.23 +);
    1.24 +
    1.25 +/**
    1.26   * Creates an iterator for the specified plain array.
    1.27   *
    1.28   * While the iterator is in use, the array may only be altered by removing
    1.29 @@ -297,7 +316,7 @@
    1.30   * @return an iterator for the specified array
    1.31   */
    1.32  __attribute__((__warn_unused_result__))
    1.33 -CxMutIterator cxIterator(  // TODO: unify the iterator types
    1.34 +CxMutIterator cxMutIterator(
    1.35          void *array,
    1.36          size_t elem_size,
    1.37          size_t elem_count,

mercurial