c++ vector source code

后端 未结 4 2268
眼角桃花
眼角桃花 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:18

    Most if not all of the std::vector source code should be contained in the header itself.

    The standard library containers are all class templates and as such, their definitions and the definitions of all of their member functions are contained in their respective headers.

    Note that there is no One True Implementation of any of the containers; each C++ Standard Library implementation is free to implement each container as it sees fit, so long as it meets the requirements for the container.

提交回复
热议问题