|
Boost Users : |
Subject: Re: [Boost-users] [range] for_each and std::map of std::list
From: Neil Groves (neil_at_[hidden])
Date: 2011-04-06 16:55:27
>
>
>> What we need is a generic range adaptor that can make a container of
> containers look like a "flat" sequence.
>
> I suggest the syntax
>
> rngOfContainers | boost::adaptors::flattened
>
> and the underlying iterator should be up to bidirectional (if the
> underlying two container types support it).
>
> Anyone interested in implementing this?
>
>
I've been interested in implementing something similar for a while. I was
thinking slightly more generally that any n-dimensional structure can often
be linearised or projected into a linear sequence. Hence this would enable
not just the above example to work, but many standard algorithms could work
with tree structures, hyper-cube trees, directed acyclic graphs etc. I've
implemented a number of these already, but wanted to gain experience with
them in my own projects before committing them to the trunk.
> -Thorsten
>
>
Regards,
Neil Groves
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net