Re: Bug in vector.hpp

Peter Kümmel <[email protected]>
Newsgroups gmane.comp.gnu.aspell.devel
Message-ID <[email protected]>
Kevin Atkinson wrote:
> On Wed, 30 Aug 2006, Peter Kümmel wrote:
> 
>> std::vector::end() returns an iterator that
>> points just beyond the end of the vector.
>>
>> So &*thin->end() is no valid code, because
>> it is a out of bound access.
>>
>> std::vector::back() returns a reference to
>> the last element and a pointer to the last
>> element is: &back().
> 
> Did this cause a problem for you?

Yes, the app crashes.

> I wonder what implementation of vector where
>   &*this->end() != &back()+1

The STL of msvc is very pedantic in the debug mode.
It checks before every dereferencing.

Peter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.