Boost logo

Boost :

Subject: Re: [boost] Is Boost.Range broken?
From: Daniel Walker (daniel.j.walker_at_[hidden])
Date: 2008-11-23 12:58:54


On Sun, Nov 23, 2008 at 1:37 AM, David Abrahams <dave_at_[hidden]> wrote:
>
> on Sat Nov 22 2008, Mathias Gaunard <mathias.gaunard-AT-ens-lyon.org> wrote:
>
>> iterator_range (which is nothing more than a fancy std::pair, I never
>> found the use of it myself)
>
> It's a bit less redundant to write the type name, since both members of
> the pair have to be the same, and it has a little more communicative power,
> since after all pair<Iter,Iter> doesn't have to represent a range; it
> has only been retroactively adapted to model Range when p.second is
> reachable from p.first.
>
> So, not completely useless, IMO.

This is a good point, and I'm a big fan of expressivity and
self-documenting code. iterator_range is a much better name for a
range than "pair", and it's also good that iterator_range has only one
template parameter for the type of iterator. I guess what turned me
off of it was its bulkiness with all those methods sticking out of it
in every direction.

Daniel Walker


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