c++矢量源代码 [英] c++ vector source code

查看:34
本文介绍了c++矢量源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取向量源代码,以了解标准 std 或 stl 向量是如何实现的.

I am trying to get the vector source code to see how the standard std or stl vector is implemented.

这是为了学习目的.现在的问题是我在哪里可以找到源代码.甚至其他 C++ Container 的源代码也有帮助.

This is for learning purpose. Now the question is where can i find the source code. Even source code of other C++ Container also helpful.

推荐答案

没有标准"向量 - 标准定义了行为和接口(以及一些实现细节,例如连续存储)但代码是编译器的事情作家确定.

There is no 'standard' vector - the standard defines behaviour and interface (and some implementation details, such as contiguous storage) but the code is a matter for compiler writers to determine.

您的编译器应该有自己的 头文件,您是否在构建包含路径中检查过这个文件?一旦您发现您还应该在各自的标头中看到其他 STL 容器.Microsoft Visual C++ 的列表在这里,包括一些专有的,所以请注意以下示例免责声明:

Your compiler should have its own <vector> header file, have you checked for this on your build include path? Once you find that you should also see the other STL containers in their respective headers. The list for Microsoft Visual C++ is here, including some that are proprietary, so watch out for that per the below sample disclaimer:

在 Visual C++ .NET 2003 中,成员 标头文件不再在 std 中命名空间,而是已被移动进入 stdext 命名空间.见标准文本命名空间以获取更多信息.

In Visual C++ .NET 2003, members of the <hash_map> and <hash_set> header files are no longer in the std namespace, but rather have been moved into the stdext namespace. See stdext Namespace for more information.

在我安装的 Visual C++ Express 2010 中,它们位于以下文件夹中:

On my installation of Visual C++ Express 2010, they are in this folder:

c:\program files\microsoft visualStudio 10.0\vc\include

c:\program files\microsoft visual Studio 10.0\vc\include

这篇关于c++矢量源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆