Boost logo

Boost Users :

From: dhruva (dhruvakm_at_[hidden])
Date: 2007-11-05 00:22:21


Hi,

On 11/5/07, LoadCom <LoadCom_at_[hidden]> wrote:
> Or, in other words, I want to test if an iterator
> itself doesn't point to any object - that is different from
> the begin() or end() of a list.

>From my little understanding of the rationale behind such a behavior,
following is my take on it.

1. The iterator is a pattern to fetch the content/s of a container
2. Hence, it really points to a location. It could either be the first
entry (begin), something till the last (including the last element) or
beyond to signify the end of the container

I do feel it would be right to have an iterator pointing to nowhere.
Maybe an uninitialized state would make sense but that would be like
have a similar state for a boolean. The boolean can either be true or
false, you do not have a third state to say that it was not
initialized. Maybe, the boost::tribool is the outcome of such a
requirement, I am just guessing though.

-dky

-- 
Dhruva Krishnamurthy
Contents reflect my personal views only!

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