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

initializes the controlled sequence with the sequence [``right``.array::begin(),right``.array::end()). You use it to specify an initial controlled sequence that is a copy of the sequence controlled by the array object right.

Return Value

A const random-access iterator that points at the first element of the range, or the location just beyond the end of an empty range (for an empty range, cbegin() == cend()).

Remarks

With the return value of cbegin, the elements in the range cannot be modified.

You can use this member function in place of the begin() member function to guarantee that the return value is const_iterator. Typically, it's used in conjunction with the auto type deduction keyword, as shown in the following example. In the example, consider Container to be a modifiable (non- const) container of any kind that supports begin() and cbegin().

Return Value

A random-access iterator that points just beyond the end of the range.

Remarks

cend is used to test whether an iterator has passed the end of its range.

You can use this member function in place of the end() member function to guarantee that the return value is const_iterator. Typically, it's used in conjunction with the auto type deduction keyword, as shown in the following example. In the example, consider Container to be a modifiable (non- const) container of any kind that supports end() and cend().

Parameters

right
Container to copy.

Remarks

The member operator assigns each element of right to the corresponding element of the controlled sequence, then returns *this. You use it to replace the controlled sequence with a copy of the controlled sequence in right.