jeudi 1 décembre 2016

Iterating 2D and 3D vectors column wise in C++11?

I have a 2D and 3D vector

vector< vector > vec_2d;

vector>> vec_3d

I know how to iterate 2D vector row-wise using two iterators. The first the iterator of the "rows" and the second the iterators of the "columns" in that "row". Now, I need to iterate over 2D vector such that the first iterator becomes the iterator of the "columns" and the second the iterator of the rows in that "column" i.e. column-wise.

Aucun commentaire:

Enregistrer un commentaire