std::list iterator not dereferencable

Mateusz Łoskot mateusz@loskot.net
Mon Mar 27 02:42:00 GMT 2006


Joe Buck wrote:
> On Mon, Mar 27, 2006 at 01:16:00AM +0200, Mateusz Łoskot wrote:
>> Today, I tried to build some Linux application using VC++ 7.1/8.0 
>> and I encountered strange GCC 3.2.3 behaviour that make me thinking
>>  about possible bug in GCC (or libstdc++, I'm not sure).
> 
> As you say, your code is invalid: the iterator points to an object
> that has been destroyed.  The behavior of different compilers on 
> invalid code is likely to depend on implementation details; it is not
> a bug that you see differences.

I understand it.
Now it seems obvious to me, that "undefined behaviour" is undefined, so
may cause different results on different compilers/platforms.

That seems to be reasonable.

Thanks
-- 
Mateusz Łoskot
http://mateusz.loskot.net



More information about the Libstdc++ mailing list