本文介绍了断言来自&lt; cassert&gt;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 为什么我可以使用来自< cassert>的断言没有解析std :: 命名空间?例如: #include< cassert> int main() { 断言(真实); //不应该这样:std :: assert(true)? } 这个编译。我想在< c ****>标题宏是unf''ed 并替换为内置函数,它们位于std 命名空间中?在这种情况下,我的程序不应该编译。我正在使用g ++ 3.3.5。 - Matthias KaepplerHi,why can I use assert from <cassert> without resolving the std::namespace? E.g.:#include <cassert>int main(){assert(true); // shouldn''t this be: std::assert(true) ?}This compiles. I thought in the <c****> headers the macros are undef''edand replaced in favor of inline functions which reside in the stdnamespace? In this case my program shouldn''t compile. I''m using g++ 3.3.5.--Matthias Kaeppler推荐答案 ''断言''是一个宏,而不是一个函数。 V''assert'' is a macro, not a function.V (你可能会进去阅读那些头文件的习惯......) - Phlip http://industrialxp.org/community/bi...UserInterfaces ''assert''是一个宏,而不是一个函数。 V ''assert'' is a macro, not a function. V 如果它没有被内联函数替换(像许多其他的 宏),那么它的重点是什么? ;&了cassert GT;标题? - Matthias KaepplerIf it hasn''t been replaced by an inline function (like many othermacros), what''s the point of the <cassert> header?--Matthias Kaeppler 这篇关于断言来自&lt; cassert&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-30 05:59