c++ vector source code

后端 未结 4 2244
眼角桃花
眼角桃花 2021-02-20 10:44

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

This is for learning purpose. Now the question is where can i find t

4条回答
  •  既然无缘
    2021-02-20 11:37

    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.

    Your compiler should have its own 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:

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

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

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

提交回复
热议问题