Boost logo

Boost :

Subject: Re: [boost] [range] for_each and std::map of std::list
From: Jeremy Maitin-Shepard (jeremy_at_[hidden])
Date: 2011-04-07 14:17:48


On 04/07/2011 04:39 AM, Mathias Gaunard wrote:
> On 07/04/2011 12:56, Thorsten Ottosen wrote:
>
>> Well, that is only a problem if you want to avoid manually applying the
>> adaptor twice (or more), right?
>>
>> If so, I think that is a limitation we can live with. A simple solution
>> covers most cases IMO.
>
> Oh, the adaptor I wrote flattens recursively.
>
> I guess just flattening the top level could be fairly easy.

You could also require that the user specify the number of levels of
recursion explicitly, as in many cases the final value_type you want to
iterate over may be a range itself. Consider, for instance, that a
string is itself a range of characters, but in many cases the user would
not want to flatten a range of strings into a range of characters.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk