Boost logo

Boost :

From: Stefan Slapeta (stefan_nospam__at_[hidden])
Date: 2004-07-19 02:51:14


David Abrahams wrote:

> If STLPort is complaining about that, it's because what you're doing
> is illegal. A default constructed standard container iterator is
> "singular", and no operations on it (including comparison) are legal
> other than assigning a non-singular iterator value into it. Although
> a few specialized iterators in std:: work differently
> (e.g. istream_iterator), in general you have to make the same
> assumption for any other iterator.

I know that but I don't know if Pavol was aware of it. The
directory_iterator in the filesystem library also has the same behaviour
if default constructed and [although it's no iterator on a standard
container and can't cause any assertions in STLPort therefore] the
filesystem documentation reads: 'Class directory_iterator provides a C++
standard conforming input iterator ...'.

>
>>Any solution which doesn't break the syntax? I don't have any idea
>>which could be implemented easily...
>
>
> Post some more detail about what you mean by "the syntax" please.
>

I meant not changing the library interface but maybe this behaviour of
default constructed iterators _has_ to be removed. I will try to find
all these occurences later.

Stefan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk