IterInitFromVec
Description
Initialize Iter from vector data to iterate in forward direction. Alignment is taken from the vector’s allocator; stack-init vecs (NULL allocator) have no alignment requirement on the data layout and collapse to alignment 1, which gives an unpadded sizeof(T) stride that matches the _Alignas(T) char[] backing buffer planted by VecInitStack.
Parameters
| Name | Direction | Description |
|---|---|---|
v |
in | Source vector (by value – the resulting iter holds a non-owning pointer into v’s buffer). |
Success
Always succeeds; returns a struct-literal Iter that reads v.length elements starting at v.data.
Failure
Macro cannot fail. Reading from the resulting iter when v.data == NULL simply has remaining-length 0.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
StrIter.h:116:
/// TAGS: StrIter, Construct, Str, Alias
///
#define StrIterFromStr(s) IterInitFromVec(s)
///
Last updated on