In C++ vector there is .reserve(size) and .capacity() methods which allow you to reserve memory for array and get current reserved size. T
vector
.reserve(size)
.capacity()