Boost logo

Boost Users :

Subject: Re: [Boost-users] Best way to put N ranges into a new container?
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2010-07-07 05:07:02

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.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at