
On Fri, Sep 17, 2010 at 11:15 AM,
I have on several occasions encountered situations in which it would be advantageous to view a container of containers as a flat sequence. It seems like there ought to be a natural way to do this using an iterator class. For instance, if you have vector
v, you ought to be able to design an iterator which begins at v.begin()->begin() and runs until v.end(), over every element of every list.
Does such a thing exist in Boost, or is it planned in the near future?
I'd be interested as well. Conversely, I just finished writing an iterator that does the opposite. It takes a flat sequence like vector<int> and allows one to iterate a "2d view" of it. So if vector<int> represents a 2D array of size 6x6, you could iterate a 3x3 view of it. I think both iterators would make a good addition to Boost.Iterators (or hopefully they already exist!) --Michael Fawcett