|
Boost Users : |
From: Brian Allison (brian_at_[hidden])
Date: 2006-09-14 14:28:21
David Abrahams wrote:
>"Peter Dimov" <pdimov_at_[hidden]> writes:
>
>
>
>>No, a singular iterator is not a valid object and it fulfills no
>>invariants.
>>
>>
>
>That's arguable. From my POV, if it's in a state that a legal program
>can create, it's within the invariant by definition.
>
>
>
Then (if I read you correctly) even undefined behavior is within the
invariant? Or have I been misunderstanding that legal programs can cause
UB? I've always considered that UB is to be treated as "not maintaining
the invariant but it's not my fault".
But then, whether we consider UB within the invariant (and hence that an
iterator is by definition always within the invariant) or whether we
consider UB outisde of the invariant but one which doesn't break
correctness (and hence that unassigned iterators are not capable of
being within/outside of an invariant)....
... is there any practical difference between those two points of view?
thanks,
Brian
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