Boost logo

Boost Users :

Subject: Re: [Boost-users] A forward iterator need not be default-constructible
From: Krzysztof Żelechowski (giecrilj_at_[hidden])
Date: 2011-09-29 05:02:18

Dave Abrahams wrote:

> on Wed Sep 28 2011, Nathan Ridge <> wrote:
>>> 2. The concept mechanism used by Boost should not require singular
>>> iterators to exist; the standard is obnoxious and misguided here and
>>> promotes sloppy coding.
>> I think the Boost authors are unlikely to decide to ignore a part of the
>> standard just because one person believes it is obnoxious and misguided
>> and promotes sloppy coding.
>> I would suggest making your case about the default constructibility of
>> forward iterators at comp.std.c++. If you gain consensus there that
>> this requirement is indeed misguided, then your request will carry
>> more weight here.
> I'd also like to point out that there's no rule saying
> default-constructed iterators must be singular.

A default-constructed iterator must be singular not because the government
says so but because of logic. You usually get wet when it rains, although
there is no rule saying that you must. Standard iterators are all singular
by default.

An exception would be an iterator to a singleton container or an iterator
defined in a closure; those are, however, edge cases.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at