C++ 编程语言:特别版在第 431 页上声明...
For every header < X.h > defining part of the C standard library in the global namespace and also in namespace std, there is a header < cX > defining the same names in the std namespace only.
但是,当我在 <cX> 样式中使用 C 标头时,我不需要限定名称空间。例如...
#include <cmath>
void f() {
double var = sqrt( 17 );
}
这会编译得很好。即使书中说使用 < cX > 标头仅在 std 命名空间中定义名称,您也可以在不限定命名空间的情况下使用这些名称。我在这里想念什么?
PS 使用 GNU.GCC 编译器