Boost logo

Boost :

Subject: Re: [boost] Is Boost.Range broken?
From: Tomas Puverle (Tomas.Puverle_at_[hidden])
Date: 2008-11-22 14:03:11


> In that case, it might be clearer to write something like
>
> iterator_range<random_number_iterator> r(random_number_iterator(),
> random_number_iterator());
>
> Here, it is explicitly initialized and thus iterator_range should know
> that this is not a singular range.
>
> That is quite a pain, of course.

You've just demonstrated a common use case which now breaks, and puts a lot of
pain on the user. Even if documented well, how often will the users write

foo(..., SpecialIteratorRange(), ...)

instead of

foo(..., SpecialIteratorRange(SpecialIterator(), SpecialIterator()), ...)

?

Less code is more.


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