
30 Sep
2011
30 Sep
'11
2:22 p.m.
2011/9/30 Krzysztof Żelechowski
Dave Abrahams wrote:
make it copyable, for example. A wrapper over a plain pointer could initialize the pointer to 0. Now it's a valid past-the-end iterator into an array of length zero. Such an iterator is also comparable with other iterators into the same sequence. That's actually far from being minimally singular.
I doubt there may be a sequence of length 0 at NULL. How would you allocate such a sequence?
You don't need to allocate anything if your sequence is of length 0, since a NULL pointer is comparable, destroyable and copyable. It can't be dereferenced nor incremented but if the sequence has length 0 you can't anyway.
Chris
-- Felipe Magno de Almeida