Std::array
lastmod 2026-11-10created 2015-03-192 edits
std::array is a fixed-size array container added in C++11 that takes the element type and size as template arguments in the form std::array<T, N>. Like a built-in array, it is stored in contiguous memory on the stack with no extra overhead, yet it provides the standard container interface such as size(), begin()/end(), and at(), as well as copy and comparison operations. Unlike a built-in array, it does not decay to a pointer when passed as a function argument, so its size information is preserved.