Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2004-08-18 00:46:19


Victor A. Wagner Jr. wrote:
> At Tuesday 2004-08-17 13:29, you wrote:
>
>> Hi,
>>
>>
>>
>> On Tue, Aug 17, 2004 at 12:56:22PM -0700, Victor A. Wagner Jr. wrote:
>> > I compiled replace_test with vs.net2005 and debugged it. It clearly
>> throws
>> > an exception, and re-throws it later from the test framework, which
>> causes
>> > the "ask to terminate abnormally" message.
>> > BUT............
>> > the output window has the following in it _before_ the exception is
>> thrown:
>> >
>> > error: list iterators incompatible, at g:\program files\microsoft
>> visual
>> > studio 8\vc\include\list: 283
>> >
>> > I'm not sure why it thinks the iterators are incompatible, but....
>> it might
>> > help the author(s) to have the above error mentioned in the failure
>> log (I
>> > don't know why it's not there)
>> >
>>
>> I have seen this error, but because I don't have access to VC8.0 I
>> couldn't
>> fix it.
>>
>> Maybe you can try to step in the debuger up to the point of the
>> exception,
>> to pinpoint me where the problem occures.
>
>
> Sure..... from the file <list> line 278 on my system
>
> #if _HAS_ITERATOR_DEBUGGING
> void _Compat(const const_iterator& _Right) const
> { // test for compatible iterator pair
> if (_Mycont == 0 || _Mycont != _Right._Mycont)
> {
> _DEBUG_ERROR("list iterators
> incompatible");
> _SCL_SECURE_INVALID_ARGUMENT;
> }
> }
>
> Looking at the variables _Mycont == 0 for both *this and _Right
> I believe that means an empty list, though I didn't investigate
> further...

No, it means that both *this and _Right are singular iterators. You're
not allowed to compare two singular iterators ...

std::list<int>::iterator i1, i2;
if( i1 == i2 ) // oops!

Someone who is familiar with the test can verify whether this is, in
fact, what is happening.

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk