
7 Jul
2010
7 Jul
'10
9:07 a.m.
Le 06/07/2010 22:49, John Dlugosz a écrit :
I was originally contemplating writing something that took some number of Range arguments and push_back'ed onto a container. Where all of them are Random Access Ranges, it can count the elements first and reserve once. Otherwise, it just concats one range at a time. Maybe could be a bit smarter, but you get the idea.
But reading through the Range docs, I'm wondering now if a better approach would be a Range Adaptor that could make a concatenated "view" (to use MPL's terminology) of all of the components put together.
Does something like that already exist?
Yes, there is a join_iterator, joined_range, and a join function.