C ++ __glibcxx *函数调用的用途是什么?

时间:2022-09-02 10:54:35

In the implementation files for the C++ STL I see a lot of functions like __glibcxx_class_requires and __glibcxx_requires_nonempty. What do these type of functions do? Should I be including these in my own files if I'm implementing a new Container that conforms to the STL standards?

在C ++ STL的实现文件中,我看到了许多函数,如__glibcxx_class_requires和__glibcxx_requires_nonempty。这些类型的功能有什么作用?如果我正在实施符合STL标准的新Container,我是否应该将这些包含在我自己的文件中?

1 个解决方案

#1


4  

These are actually not functions, but macros, many defined here:

这些实际上不是函数,而是宏,这里定义了很多:

http://www.ib.cnea.gov.ar/~oop/biblio/libstdc++/debug_8h.html

Mostly used for debug and are defined in debug.h. Can also use for in-line asserts to prevent a program from continuing if certain conditions are met (not met).

主要用于调试,并在debug.h中定义。也可以用于内联断言,以防止程序在满足某些条件(未满足)时继续。

#1


4  

These are actually not functions, but macros, many defined here:

这些实际上不是函数,而是宏,这里定义了很多:

http://www.ib.cnea.gov.ar/~oop/biblio/libstdc++/debug_8h.html

Mostly used for debug and are defined in debug.h. Can also use for in-line asserts to prevent a program from continuing if certain conditions are met (not met).

主要用于调试,并在debug.h中定义。也可以用于内联断言,以防止程序在满足某些条件(未满足)时继续。