Re: strange crash after assertion with std::map::iterator
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Wed, 25 Apr 2007 08:04:35 -0400
"Mycroft Holmes" <m.holmes@xxxxxxxxx> wrote in message
news:eIVybCxhHHA.4976@xxxxxxxxxxxxxxxxxxxx
first, iterators DO contain pointers; I cannot prove it, but I'd bet
it's IMPOSSIBLE to design an iterator without making use of pointers.
Stream iterators are unlikely to contain pointers. Maybe a pointer to
the stream, but definitely not a pointer to T (T being the type of
elements iterated over).
vector::iterator could very well hold an index rather than a pointer.
I don't quite understand how this issue is relevant, though.
second, I never said that a value-initialized iterator should be the
end of anything. I just said it should be a VALID ITERATOR, and I
made clear what I mean by "valid": just equality and inequality
comparable.
Comparable to what? What should be the result of such a comparison?
Perhaps more importantly, _why_ do you want that? In what situation
would you like to be able to use such a facility?
As an aside, note that output iterators aren't required to be equality
comparable at all, singular values or otherwise (C++ standard 24.1.2,
Table 73).
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- References:
- strange crash after assertion with std::map::iterator
- From: Mycroft Holmes
- Re: strange crash after assertion with std::map::iterator
- From: Tom Widmer [VC++ MVP]
- Re: strange crash after assertion with std::map::iterator
- From: Mycroft Holmes
- Re: strange crash after assertion with std::map::iterator
- From: Igor Tandetnik
- Re: strange crash after assertion with std::map::iterator
- From: Duane Hebert
- Re: strange crash after assertion with std::map::iterator
- From: Mycroft Holmes
- Re: strange crash after assertion with std::map::iterator
- From: Duane Hebert
- Re: strange crash after assertion with std::map::iterator
- From: Mycroft Holmes
- Re: strange crash after assertion with std::map::iterator
- From: Duane Hebert
- Re: strange crash after assertion with std::map::iterator
- From: Ulrich Eckhardt
- Re: strange crash after assertion with std::map::iterator
- From: Mycroft Holmes
- Re: strange crash after assertion with std::map::iterator
- From: Duane Hebert
- Re: strange crash after assertion with std::map::iterator
- From: Mycroft Holmes
- strange crash after assertion with std::map::iterator
- Prev by Date: Re: strange crash after assertion with std::map::iterator
- Next by Date: Re: strange crash after assertion with std::map::iterator
- Previous by thread: Re: strange crash after assertion with std::map::iterator
- Next by thread: Re: strange crash after assertion with std::map::iterator
- Index(es):
Relevant Pages
|