Boost logo

Boost Users :

Subject: Re: [Boost-users] A forward iterator need not be default-constructible
From: Felipe Magno de Almeida (felipe.m.almeida_at_[hidden])
Date: 2011-09-30 10:45:28

On Fri, Sep 30, 2011 at 11:24 AM, Andrew Sutton <asutton.list_at_[hidden]> wrote:
>> I doubt there may be a sequence of length 0 at NULL.  How would you allocate
>> such a sequence?
> Actually, every iterator (singular, initialized, pointing to viable
> memory or not) defines its own empty range. That is, for every i, [i,
> i) is an empty range, which means that, if all you know is that you
> have that range, then it is not valid to increment, decrement, or
> dereference. You can certainly construct an empty range on nullptr.

You can't equally-compare a singular iterator.

Felipe Magno de Almeida

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