c++ - 从 std `vector` 库创建的 `` 和从 : `STL vec


为什么STD库中有两个不同的 vector 库?


  1. STL_vector.h
  2. vector.h

两者有什么区别?

最佳答案

如果你看into the file本身你会看到

/** @file bits/stl_vector.h
 *  This is an internal header file, included by other library headers.
 *  Do not attempt to use it directly. @headername{vector}
 */

您的代码不应直接包含 STL_vector.h。它是 libstdc++ 的实现细节,在其他标准库实现中可能不存在。

关于c++ - 从 std `vector` 库创建的 `<vector>` 和从 : `STL vector` 创建的 `<STL_vector.h>` 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70259260/

相关文章:

ios - 是否有修改器可以更改 SwiftUI Picker 的标签颜色?

c++ - 将不同枚举类类型作为输入的函数,怎么样?

powershell - 设置 PSReadLineOption : A parameter can

python - 无法让 VS Code 将参数从 launch.json 传递给 Python

tailwind-css - 如何使用 Tailwind CSS 定位具有特定数据属性的元素?

python - 如何检查字符串中的特定元素在python中是否相等?

angular - TS2322 : Type 'HTMLDivElement' is not as

java - 如何删除连续位置的所有重复项?

regex - 如何在 perl regex 替换命令中使用 unicode 字符?

java - 如何将具有相同键但不同值的多个 map 合并为一个 map