Search code examples
c++libc++

Where is `class vector` implemented in libcxx?


I would like to find the implementation of class vector in libcxx. However, in the header file vector of libcxx, https://github.com/llvm/llvm-project/blob/main/libcxx/include/vector , there is only class vector defined in comment region, instead of in source region.

Where is class vector really defined?


Solution

  • It's right there, around line 472:

    template <class _Tp, class _Allocator /* = allocator<_Tp> */>
    class _LIBCPP_TEMPLATE_VIS vector
        : private __vector_base<_Tp, _Allocator>
    {
        . . .