Boost logo

Boost Users :

Subject: Re: [Boost-users] A forward iterator need not be default-constructible
From: Andrew Sutton (asutton.list_at_[hidden])
Date: 2011-09-30 10:26:08

>> template<typename I>
>>   auto f() { I i; assert(*i); } // worst algorithm ever

> OTOH, if I know that a singular iterator of some type would have no valid
> operations, and the iterator is only meant to be used by algorithms, the
> benefit of being unable to create a singular iterator (like when the
> iterator in question holds a reference to supporting data used in its
> operation) outweighs the benefit of being able to do so.

I think I've lost the thread of the argument. Are you saying that you
should *not* be able to default construct iterators?

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