Phosphor
gsl_p::multidimensional_iterator< T > Class Template Reference

#include <iterator.h>

Public Member Functions

 multidimensional_iterator (T parent_, T parent_end_)
 
const child_value_type & operator* () const
 
const child_value_type * operator-> () const
 
__selfoperator++ ()
 
bool operator== (const __self &other) const
 
bool operator!= (const __self &other) const
 

Protected Member Functions

void seekChildForward ()
 

Detailed Description

template<typename T>
class gsl_p::multidimensional_iterator< T >

An iterator for iterating over a container of containers

Example: a vector of vectors of int

std::vector<std::vector<int>> vecvec; vecvec.push_back(std::vector<int>({1, 2})); vecvec.push_back(std::vector<int>({4, 5}));

gsl_p::multidimensional_iterator< decltype(vecvec)::iterator> start(vecvec.begin()); gsl_p::multidimensional_iterator< decltype(vecvec)::iterator> finish(vecvec.end());

for(auto iter = start; iter != finish; ++iter) { std::cout << *iter << std::endl; }

Output:

1 2 4 5

Template Parameters
Tparent iterator type (e.g. std::vector<std::vector<int>>::iterator)

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