Mojo function
zip
zip[origin: ImmutableOrigin, n: Int](ts: InlineArray[Pointer[IntTuple, origin], n]) -> _zip[origin, n]
Create a zip iterator from an array of IntTuple
pointers.
This function creates a zip iterator that allows simultaneous traversal
of multiple IntTuple
collections.
Parameters:
- origin (
ImmutableOrigin
): The origin tracking parameter for memory safety. - n (
Int
): The number ofIntTuple
collections being zipped together.
Args:
- ts (
InlineArray[Pointer[IntTuple, origin], n]
): Array of pointers to theIntTuple
collections to zip.
Returns:
A _zip
object that can be iterated over.
zip(a: IntTuple[origin], b: IntTuple[origin], out result: _zip[{a, b}, 2])
Create a zip iterator for two IntTuple
s.
This function creates a zip iterator that allows simultaneous traversal
of two IntTuple
s, yielding pairs of corresponding elements.
Args:
- a (
IntTuple[origin]
): FirstIntTuple
to zip. - b (
IntTuple[origin]
): SecondIntTuple
to zip.
Returns:
The resulting zip iterator for the input IntTuple
s.
zip(a: IntTuple[origin], b: IntTuple[origin], c: IntTuple[origin], out result: _zip[{a, b, c}, 3])
Create a zip iterator for three IntTuple
s.
This function creates a zip iterator that allows simultaneous traversal
of three IntTuple
s, yielding triplets of corresponding elements.
Args:
- a (
IntTuple[origin]
): FirstIntTuple
to zip. - b (
IntTuple[origin]
): SecondIntTuple
to zip. - c (
IntTuple[origin]
): ThirdIntTuple
to zip.
Returns:
The resulting zip iterator for the input IntTuple
s.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!