Description

The template class describes an object that controls a sequence of length N of elements of type Ty. The sequence is stored as an array of Ty, contained in the array<Ty, N> object.

The type has a default constructor array() and a default assignment operator operator=, and satisfies the requirements for an aggregate. Thus, objects of type array<Ty, N> can be initialized with an aggregate initializer. For example:

    array<int, 4> ai = { 1, 2, 3 };

creates the object ai which holds four integer values, initializes the first three elements to the values 1, 2, and 3 respectively, and initializes the fourth element to 0.