Boost logo

Boost :

Subject: [boost] [range] new adaptor for iterating over equal_ranges
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2010-04-22 16:47:02


Hi Neil & others,

I think it could be useful with a range adaptor of the following kind to
iterate over equal_ranges in a multimap. E.g.

   SomeMultiMap map = ...;
   for( auto rng : map | boost::adaptors::equal_ranged )
      for( auto iter : rng )
      {
        // do something with the objects with equal keys
      }

The resulting range would probably be bidirectional with value_type
std::pair<boost::range_iterator<SomeMultiMap>::type,...>.

Thoughts?

-Thorsten


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