ucx/cx/iterator.h

changeset 112
c3f2f16fa4b8
parent 102
64ded9f6a6c6
child 113
dde28a806552
--- a/ucx/cx/iterator.h	Sat Oct 04 14:54:25 2025 +0200
+++ b/ucx/cx/iterator.h	Sun Oct 19 21:20:08 2025 +0200
@@ -70,6 +70,10 @@
      */
     void (*next)(void *);
     /**
+     * Original implementation in case the function needs to be wrapped.
+     */
+    void (*next_impl)(void *);
+    /**
      * Indicates whether this iterator may remove elements.
      */
     bool mutating;
@@ -141,7 +145,7 @@
  * Iterator type.
  *
  * An iterator points to a certain element in a (possibly unbounded) chain of elements.
- * Iterators that are based on collections (which have a defined "first" element), are supposed
+ * Iterators that are based on collections (which have a defined "first" element) are supposed
  * to be "position-aware", which means that they keep track of the current index within the collection.
  *
  * @note Objects that are pointed to by an iterator are always mutable through that iterator. However,
@@ -178,7 +182,7 @@
 #define cxIteratorNext(iter) (iter).base.next(&iter)
 
 /**
- * Flags the current element for removal, if this iterator is mutating.
+ * Flags the current element for removal if this iterator is mutating.
  *
  * Does nothing for non-mutating iterators.
  *
@@ -210,7 +214,7 @@
 /**
  * Creates an iterator for the specified plain array.
  *
- * The @p array can be @c NULL in which case the iterator will be immediately
+ * The @p array can be @c NULL, in which case the iterator will be immediately
  * initialized such that #cxIteratorValid() returns @c false.
  *
  * This iterator yields the addresses of the array elements.
@@ -244,7 +248,7 @@
  * moving all subsequent elements by one. Usually, when the order of elements is
  * not important, this parameter should be set to @c false.
  *
- * The @p array can be @c NULL in which case the iterator will be immediately
+ * The @p array can be @c NULL, in which case the iterator will be immediately
  * initialized such that #cxIteratorValid() returns @c false.
  *
  *
@@ -268,9 +272,9 @@
  * Creates an iterator for the specified plain pointer array.
  *
  * This iterator assumes that every element in the array is a pointer
- * and yields exactly those pointers during iteration (while in contrast
- * an iterator created with cxIterator() would return the addresses
- * of those pointers within the array).
+ * and yields exactly those pointers during iteration (on the other
+ * hand, an iterator created with cxIterator() would return the
+ * addresses of those pointers within the array).
  *
  * @param array a pointer to the array (can be @c NULL)
  * @param elem_count the number of elements in the array

mercurial