Phosphor
|
#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 |
__self & | operator++ () |
bool | operator== (const __self &other) const |
bool | operator!= (const __self &other) const |
Protected Member Functions | |
void | seekChildForward () |
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
T | parent iterator type (e.g. std::vector<std::vector<int>>::iterator) |