Utopia 2
Framework for studying models of complex & adaptive systems.
Loading...
Searching...
No Matches
Classes | Functions
Utopia::Itertools Namespace Reference

Tools for iterating over collections. More...

Classes

class  zip
 A range defined by instances of ZipIterator. More...
 
class  ZipIterator
 Iterator over an arbitrary number of collections. More...
 

Functions

template<typename... Iterators>
 ZipIterator (std::tuple< Iterators... > iters) -> ZipIterator< Iterators... >
 Deduce the iterator types from the types inside the tuple.
 
template<typename Adaptor , typename... Containers>
auto adapt_zip (Adaptor &&adaptor, Containers &... containers)
 Return a zip iterator built from an adapter applied to containers.
 
template<typename... Containers>
auto begin (zip< Containers... > &zipper)
 Begin function like std::begin.
 
template<typename... Containers>
auto end (zip< Containers... > &zipper)
 end function like std::end
 
template<typename... Containers>
auto cbegin (zip< Containers... > &zipper)
 Begin function like std::begin.
 
template<typename... Containers>
auto cend (zip< Containers... > &zipper)
 end function like std::end
 
template<typename... Containers>
auto rbegin (zip< Containers... > &zipper)
 Begin function like std::begin.
 
template<typename... Containers>
auto rend (zip< Containers... > &zipper)
 end function like std::end
 

Detailed Description

Tools for iterating over collections.

Function Documentation

◆ begin()

template<typename... Containers>
auto Utopia::Itertools::begin ( zip< Containers... > &  zipper)

Begin function like std::begin.

Template Parameters
Containers
Parameters
zipper
Returns
auto
538{
539 return zipper.begin();
540}
auto begin()
make Zipiterator containing the begin iterators of the containers 'zip' refers to
Definition zip.hh:422

◆ cbegin()

template<typename... Containers>
auto Utopia::Itertools::cbegin ( zip< Containers... > &  zipper)

Begin function like std::begin.

Template Parameters
Containers
Parameters
zipper
Returns
auto
564{
565 return zipper.cbegin();
566}
auto cbegin()
make Zipiterator containing the const begin iterators of the containers 'zip' refers to
Definition zip.hh:446

◆ cend()

template<typename... Containers>
auto Utopia::Itertools::cend ( zip< Containers... > &  zipper)

end function like std::end

Template Parameters
Containers
Parameters
zipper
Returns
auto
577{
578 return zipper.cend();
579}
auto cend()
make Zipiterator containing the const end iterators of the containers 'zip' refers to
Definition zip.hh:458

◆ end()

template<typename... Containers>
auto Utopia::Itertools::end ( zip< Containers... > &  zipper)

end function like std::end

Template Parameters
Containers
Parameters
zipper
Returns
auto
551{
552 return zipper.end();
553}
auto end()
make Zipiterator containing the end iterators of the containers 'zip' refers to
Definition zip.hh:434

◆ rbegin()

template<typename... Containers>
auto Utopia::Itertools::rbegin ( zip< Containers... > &  zipper)

Begin function like std::begin.

Template Parameters
Containers
Parameters
zipper
Returns
auto
590{
591 return zipper.rbegin();
592}
auto rbegin()
make Zipiterator containing the reverse begin iterators of the containers 'zip' refers to
Definition zip.hh:470

◆ rend()

template<typename... Containers>
auto Utopia::Itertools::rend ( zip< Containers... > &  zipper)

end function like std::end

Template Parameters
Containers
Parameters
zipper
Returns
auto
603{
604 return zipper.rend();
605}
auto rend()
make Zipiterator containing the reverse end iterators of the containers 'zip' refers to
Definition zip.hh:482

◆ ZipIterator()

template<typename... Iterators>
Utopia::Itertools::ZipIterator ( std::tuple< Iterators... >  iters) -> ZipIterator< Iterators... >

Deduce the iterator types from the types inside the tuple.