C Collections

citerators · Section 3

ccol_iter_next

ccol_iter_next - move a unified iterator on to the next element

C Collections (libccollections, -lccollections)

#include <ccollections/citerators.h>   /* or any container header */
 
cmap_iterator *ccol_iter_next(it);

ccol_iter_next moves the iterator to the next element by calling its
ccol__next_fn callback. At the end of the sequence it destroys the iterator
and returns NULL. The argument is evaluated exactly once.

it   Iterator variable that ccol_iter_declare() declares, or an iterator
     inside ccol_for_each().

The new value of the iterator, or NULL after the last element.

Once ccol_iter_next() has returned NULL the iterator is already
destroyed, so do not call ccol_iter_destroy() on it after that.

ccol_begin(3), ccol_iter_declare(3), ccol_iter_destroy(3)