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-10-02 19:08:37


>>> No again.  Objects of this type are not singular iterators:

>>> Singular values crop up in all kinds of contexts, BTW.  Do ints support
>>> division?  Well, yes, unless the denominator is zero.
>>
>> I'm sorry. This is completely wrong. 0 is value -- a state of an
>> numeric type -- just like singularity is the state of some iterators.
>
> Yes.  I don't see that as a contradiction.

It sounded to me like you were equating the state of singularity with
a type. This explanation makes your meaning more clear.

> - Not every type has singular values
> - Some types have multiple singular values
> - In general, one type's singular values are distinct from another
>  type's singular values

I think this discussion that confirms my original claim that talking
about valid iterators is troublesome -- I think, singular iterators,
by extension. With such a vaguely defined notion of singularity we
need more concrete properties to reason about the validity of
operations on such iterators.

What are the properties of an iterator that could cause operations on
it to result in undefined behavior? It's position in a valid range. I
think discussing the validity of iterators without the context of some
"source" range is not meaningful. This is also EoP's approach; I don't
recall reading about singular iterators there (but I don't have the
book in front of me so I can't check).

> I don't know what you and Chris mean by "independent of type," but to me
> this sounds like singularity is highly dependent on type.  I suspect
> this situation is less one of "you're completely wrong" than "you and I
> are understanding the same words in different ways."

Independent as in, not bound to any specific type, but also dependent
as in, a type might define its own notion of singularity. You're
right. Same thing, different words :)


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