cpp/container/array

is a container that encapsulates fixed size arrays.

This container is an aggregate type with the same semantics as a struct holding a C-style array as its only non-static data member. Unlike a C-style array, it doesn't decay to automatically. As an aggregate type, it can be initialized with aggregate-initialization given at most initializers that are convertible to :.

The struct combines the performance and accessibility of a C-style array with the benefits of a standard container, such as knowing its own size, supporting assignment, random access iterators, etc.

satisfies the requirements of and  except that default-constructed array is not empty and that the complexity of swapping is linear,  and partially satisfies the requirements of.

There is a special case for a zero-length array. In that case,, which is some unique value. The effect of calling or  on a zero-sized array is undefined.

An array can also be used as a tuple of elements of the same type.

Iterator invalidation
As a rule, iterators to an array are never invalidated throughout the lifetime of the array. One should take note, however, that during, the iterator will continue to point to the same array element, and will thus change its value.