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:24:43


> 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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net