--- a/src/ucx/cx/iterator.h Sun Jul 09 15:14:26 2023 +0200 +++ b/src/ucx/cx/iterator.h Mon Jul 10 18:39:24 2023 +0200 @@ -51,6 +51,8 @@ /** * Returns a pointer to the current element. + * + * When valid returns false, the behavior of this function is undefined. */ __attribute__ ((__nonnull__)) void *(*current)(void const *); @@ -63,12 +65,16 @@ /** * Advances the iterator. + * + * When valid returns false, the behavior of this function is undefined. */ __attribute__ ((__nonnull__)) void (*next)(void *); /** * Flag current element for removal, if possible. + * + * When valid returns false, the behavior of this function is undefined. */ __attribute__ ((__nonnull__)) bool (*flag_removal)(void *); @@ -198,13 +204,13 @@ /** * Iterator value type. - * An iterator points to a certain element in an (possibly unbounded) chain of elements. + * 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 * 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, * this iterator cannot mutate the collection itself (add or remove elements) and any mutation of the - * collection by other means make this iterator invalid (regardless of what cxIteratorValid() returns). + * collection by other means makes this iterator invalid (regardless of what cxIteratorValid() returns). * * @see CxMutIterator */