Hello, Suppose I have a container of containers and would like an iterator that goes through all of their elements as if they are coming from a single container. I thought I would see some Boost class helping me to do that but I couldn't find anything like that. Can someone please tell me if that is true, and if not, which class can I use to that effect? (In fact this concept is more general and interesting. The objects in the first-level containers may not be containers but have members which are containers and whose elements I want to iterate through. Or they could be iterators. The general case should allow a parameterizable way of obtaining an iterator to the elements inside the second-level objects. This could again be a nesting iterator, allowing for arbitraty nesting. Since this is a fairly common need in programming, I was expecting something that did that in Boost.) Thanks, Rodrigo
"Rodrigo de Salvo Braz"
Hello,
Suppose I have a container of containers and would like an iterator that goes through all of their elements as if they are coming from a single container. I thought I would see some Boost class helping me to do that but I couldn't find anything like that. Can someone please tell me if that is true, and if not, which class can I use to that effect?
You might try the View Template Library (VTL) by Gary Powell and Martin Weiser: http://www.zib.de/weiser/vtl/ In particular, the concatenation_view allows you to treat a container of containers as a single container containing all the elements of the member containers: http://www.zib.de/weiser/vtl/concatenation_view.html Jonathan
participants (2)
-
Jonathan Turkanis
-
Rodrigo de Salvo Braz