Subject: Re: [boost] Is Boost.Range broken?
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2008-11-22 19:24:12


Tomas Puverle wrote:

>> It's not an empty range, it's more like a pointer to somewhere random.
>
> This is not the case - there are plenty of iterators which have valid semantics
> when default constructed, including some in the standard library.

Sure there are, but that's irrelevant. The standard doesn't require
iterators that have been constructed to be in a valid state, and that's
all there is to it.
It's not a matter of choice of design. It's a matter of following the
standard.

In your specific case it's not a problem, but iterator_range aims at
being generic.

As I said, if it was just me, I would have designed the iterator
concepts differently so as *not* to require default construction, which
standard iterator concepts do, and that is bringing the singular states in.