c++ - C++ 标准库函数和类是否包含在每个 C++ 实现中?

标签 c++

我只是好奇,因为在我的家庭作业中它说以下陈述是:

The C++ Standard Library functions and classes are not included in every C++ implementation.

我不认为标准库包含在每个 C++ 实现中,除非您添加 (#include) 适当的 header ,对吗?既然如此,我认为上述说法是正确的,而不是错误的

这句话是还是

最佳答案

不幸的是,“include”一词重载了。

您的 C++ 编译器附带包含标准库的文件。所以他们被“包括”了。但它们不是 #include-d,您必须在源文件中编写 #include 才能访问标准库。

此外,还有托管独立 实现。标准是这样说的:

Two kinds of implementations are defined: a hosted implementation and a freestanding implementation. For a hosted implementation, this International Standard defines the set of available libraries. A freestanding implementation is one in which execution may take place without the benefit of an operating system, and has an implementation-defined set of libraries that includes certain language-support libraries (17.6.1.3).

由于该声明说“每个 C++ 实现”,并且独立实现不包括整个 C++ 标准库,因此该声明是正确的

关于c++ - C++ 标准库函数和类是否包含在每个 C++ 实现中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8956160/

相关文章:

c++ - 在已打开的文件上删除ItemAtPath

c++ - 如何将 UDF 添加到 MySQL?

c++ - 概念 std::equality_comparable_with 不适用于用户定义的相等运算符

c++ - 在我的 C++ 程序中有一种方法可以检查 CPU 是否有 AES-NI

c++ - 声明时初始化的char数组?

C++ 确保浮点大小为 4 个字节

c++ - cout 在控制台窗口中单击鼠标时挂起

c++ - 将 cv::Mat 转换为 IplImage*

c++ - 是否可以在实现文件中使用命名空间或等效项来避免在每个函数前加上类名?

c++ - GCC 无法使用 init-capture 捕获 'this' 指向模板类型的指针