⚡ DEVLOG STREAM

Connecting…
Standing by for incoming session telemetry…

C++ Standard Template Library: std::vector Specification

From ISO/IEC 14882:2020 Working Draft & System Programming Reference


1. Memory Model & Layout

In standard C++ implementations, std::vector maintains a contiguous dynamic array controlled by three pointer boundaries:

template <typename T, typename Allocator = std::allocator<T>>
class vector {
    T* _M_start;          // Beginning of elements
    T* _M_finish;         // End of constructed elements
    T* _M_end_of_storage; // End of allocated heap capacity
};

2. Growth Invariants

When capacity is exceeded, implementations allocate a replacement buffer with geometric growth (typically 2.0x in MSVC, 1.5x in GCC/Clang), relocate initialized objects, and reclaim the previous storage block.

Reference Section 23.3.11 // Double-click or press Ctrl+Alt+K to resume.