Skip to content

IterMustRead

Description

Aborting variant of IterRead. See that macro for parameter semantics and success-state effects.

Success

Returns to the caller; the underlying IterRead succeeded.

Failure

Does not return - aborts via LOG_FATAL when the iterator is exhausted.

Usage example (Cross-references)

Usage examples (Cross-references)
    /// TAGS: StrIter, Read, Must, Alias
    ///
    #define StrIterMustRead(mi, out) IterMustRead((mi), (out))
    
    ///
        do {                                                                                                               \
            if (!IterRead((mi), (out))) {                                                                                  \
                LOG_FATAL("IterMustRead: iterator exhausted");                                                             \
            }                                                                                                              \
        } while (0)
        u8       v;
        IterRead(&it, &v);
        IterMustRead(&it, &v);
        return true;
    }
Last updated on