标准库和标准模板库有什么区别?
我不断看到对 C++ 标准库和 C++ 标准模板库 (STL) 的引用。它们之间有什么区别?维基百科提到他们共享一些标题,但仅此而已。
I keep seeing reference to both the C++ standard Library and the C++ Standard Template Library (STL). What is the difference between them? Wikipedia mentions that they share some headers but that's about it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
标准模板库 (STL) 是一个容器库,迭代器、算法和函数对象,由 Alexander Stepanov 创建; SGI 网站有规范的实现和文档。
标准库是 C++ 的一部分;它包括大部分标准模板库(STL)。
在常见用法中,“STL”也用于指代 C++ 标准库中来自或派生自实际 SGI STL 的部分。例如,人们经常使用“STL”来指代
std::vector
以及 C++ 标准库中的其余容器,因为它们起源于 SGI STL。The Standard Template Library (STL) is a library of containers, iterators, algorithms, and function objects, that was created by Alexander Stepanov; the SGI website has the canonical implementation and documentation.
The standard library is the library that is part of C++; it includes most of the Standard Template Library (STL).
In common usage, "STL" is also used to refer to the parts of the C++ standard library that come from or are derived from the actual SGI STL. For example, people often use "STL" to refer to
std::vector
and the rest of the containers in the C++ standard library, since they originated in the SGI STL.