
"Jeremy Maitin-Shepard" <jbms@attbi.com> wrote
Perhaps in addition to a data() function, it would be useful if the container provided constant-time access to the data as two arrays. Perhaps something like std::pair<T *, T *> first_range() and std::pair<T *, T *> second_range(). (Where these can also be made available in const-form, since no internal modification is necessary) Then as Thorsten suggested, an operation such as linearize or reorder could be added which orders the elements such that first_range() contains all of the elements.
data() does 'linearization' when needed (it was called flatten() when I proposed it ago). Do you have an example where returning two arrays is much better than optional reordering by data()? What kind of algorithm would be better to be called twice? /Pavel