STL列表代码在VC ++ 2005中触发断言,但不在VC ++ 2003中触发。 [英] STL list code fires assertion in VC++ 2005, but not in VC++ 2003.

查看:30
本文介绍了STL列表代码在VC ++ 2005中触发断言,但不在VC ++ 2003中触发。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从正在检查的列表迭代器中得到一个断言。

对NULL。这在VC ++ 2003(v7.1)中没有发生。在这些版本之间是否已经对STL进行了更改?b
应该知道哪些?我应该检查的任何资源?


谢谢,

杰森

解决方案

Jason Doucette写道:


我从正在检查的列表迭代器中得到一个断言。

对NULL。



你为什么这样做?


这在VC ++ 2003(v7.1)中没有发生。在这些版本之间是否已经对STL进行了更改?b
应该知道哪些?



可能。实际上,非常有可能。


我应该检查的任何资源?



常见问题5.8


V

-

请在通过电子邮件回复时删除资本''A'

我没有回复最热门的回复,请不要问


我正在从列表迭代器被检查中得到一个断言:


对NULL。



你为什么这样做?



因为我有一个函数来报告元素是否在
列表中。如果是,则返回该元素的迭代器。如果它不是
,那么它返回NULL。


这个坏吗?它在VC ++ 2003中运行良好。但是,

STL列表类的内部似乎不再喜欢它了。


这在VC ++ 2003(v7.1)中没有出现。在这些版本之间是否已经对STL进行了更改?b
应该知道哪些?



可能。实际上,非常有可能。



我记得很久以前读过一些东西,他们已经做了一些

的变化。不过,我似乎找不到合适的资源。


我应该检查的任何资源?



FAQ 5.8



手册是什么? C ++标准?我不认为这是公开的

可用。


谢谢,Victor。


杰森


常见问题5.8


对不起,您的意思是新闻组常见问题,显然,是的。我忘记了

我回复的新闻组。


欢呼,

Jason


I''m getting an assertion fire from a list iterator being checked
against NULL. This did not occur in VC++ 2003 (v7.1). Are there
changes that have been made to the STL between these versions that I
should know about? Any resources I should check into?

thanks,
Jason

解决方案

Jason Doucette wrote:

I''m getting an assertion fire from a list iterator being checked
against NULL.

Why are you doing that?

This did not occur in VC++ 2003 (v7.1). Are there
changes that have been made to the STL between these versions that I
should know about?

Probably. Actually, very likely.

Any resources I should check into?

FAQ 5.8

V
--
Please remove capital ''A''s when replying by e-mail
I do not respond to top-posted replies, please don''t ask


I''m getting an assertion fire from a list iterator being checked

against NULL.


Why are you doing that?

Because I have a function that reports whether or not an element is in
the list. If it is, it returns an iterator to that element. If it''s
not, then it returns NULL.

Is this bad? It worked fine in VC++ 2003. But, the internals of the
STL list class doesn''t seem to like it, anymore.

This did not occur in VC++ 2003 (v7.1). Are there
changes that have been made to the STL between these versions that I
should know about?


Probably. Actually, very likely.

I recall reading something a long time ago that they had made some
changes. I can''t seem to find a decent resource on this, though.

Any resources I should check into?


FAQ 5.8

Of what manual? The C++ Standard? I don''t think it''s publicly
available.

Thanks, Victor.

Jason


FAQ 5.8

Sorry, you mean the newsgroup FAQ, obviously, duh. I had forgotten
which newsgroup I was replying to.

cheers,
Jason


这篇关于STL列表代码在VC ++ 2005中触发断言,但不在VC ++ 2003中触发。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆