R-Type  2
Doom but in better
Loading...
Searching...
No Matches
Zipper< Containers > Class Template Reference

Combines multiple containers into a single iterable unit, iterating over corresponding elements from each container. More...

#include <Zipper.hpp>

Collaboration diagram for Zipper< Containers >:
Collaboration graph

Public Types

using iterator = ZipperIterator<Containers...>
 Type alias for the iterator type used to traverse the zipped containers.
 
using iterator_t = typename iterator::iterator_tuple
 Type alias for the tuple of iterators used in the zipped containers.
 

Public Member Functions

 Zipper (Containers &... cs)
 Constructs a Zipper with the provided containers.
 
iterator begin ()
 Returns an iterator to the beginning of the zipped containers.
 
iterator end ()
 Returns an iterator to the end of the zipped containers.
 

Detailed Description

template<class... Containers>
class Zipper< Containers >

Combines multiple containers into a single iterable unit, iterating over corresponding elements from each container.

The Zipper class allows simultaneous iteration over multiple containers. It provides an interface to iterate over a tuple of elements from the containers at the same position.

Template Parameters
ContainersVariadic template parameter for the types of containers to zip together.

Definition at line 15 of file Zipper.hpp.

Member Typedef Documentation

◆ iterator

template<class... Containers>
using Zipper< Containers >::iterator = ZipperIterator<Containers...>

Type alias for the iterator type used to traverse the zipped containers.

Definition at line 18 of file Zipper.hpp.

◆ iterator_t

template<class... Containers>
using Zipper< Containers >::iterator_t = typename iterator::iterator_tuple

Type alias for the tuple of iterators used in the zipped containers.

Definition at line 20 of file Zipper.hpp.

Constructor & Destructor Documentation

◆ Zipper()

template<class... Containers>
Zipper< Containers >::Zipper ( Containers &... cs)
inline

Constructs a Zipper with the provided containers.

Parameters
csReferences to the containers to be zipped together.

Definition at line 27 of file Zipper.hpp.

Member Function Documentation

◆ begin()

template<class... Containers>
iterator Zipper< Containers >::begin ( )
inline

Returns an iterator to the beginning of the zipped containers.

Returns
An iterator pointing to the first tuple of elements from the zipped containers.

Definition at line 36 of file Zipper.hpp.

◆ end()

template<class... Containers>
iterator Zipper< Containers >::end ( )
inline

Returns an iterator to the end of the zipped containers.

Returns
An iterator pointing past the last tuple of elements from the zipped containers.

Definition at line 45 of file Zipper.hpp.


The documentation for this class was generated from the following file: