array 클래스(STL)
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.
template<class Ty, std::size_t N>
class array;
매개 변수
Parameter |
설명 |
Ty |
요소의 형식입니다. |
N |
요소 수입니다. |
멤버
Type Definition |
설명 |
제어되는 시퀀스에 대한 상수 반복기의 형식입니다. |
|
요소에 대한 상수 포인터의 형식입니다. |
|
요소에 대한 상수 참조의 형식입니다. |
|
The type of a constant reverse iterator for the controlled sequence. |
|
두 요소 사이의 부호가 있는 거리의 형식입니다. |
|
제어되는 시퀀스에 대한 반복기의 형식입니다. |
|
요소에 대한 포인터의 형식입니다. |
|
요소에 대한 참조의 형식입니다. |
|
The type of a reverse iterator for the controlled sequence. |
|
두 요소 사이의 부호가 없는 거리의 형식입니다. |
|
요소의 형식입니다. |
Member Function |
설명 |
Constructs an array object. |
|
Replaces all elements. |
|
Accesses an element at a specified position. |
|
Accesses the last element. |
|
제어되는 시퀀스의 시작을 지정합니다. |
|
Returns a random-access const iterator to the first element in the array. |
|
Returns a random-access const iterator that points just beyond the end of the array. |
|
Returns a const iterator to the first element in a reversed array. |
|
Returns a const iterator to the end of a reversed array. |
|
Gets the address of the first element. |
|
Tests whether elements are present. |
|
제어되는 시퀀스의 끝을 지정합니다. |
|
Replaces all elements with a specified value. |
|
Accesses the first element. |
|
요소의 수를 셉니다. |
|
역방향 제어되는 시퀀스의 시작을 지정합니다. |
|
역방향 제어되는 시퀀스의 끝을 지정합니다. |
|
요소의 수를 셉니다. |
|
두 컨테이너의 내용을 바꿉니다. |
연산자 |
설명 |
Replaces the controlled sequence. |
|
Accesses an element at a specified position. |
설명
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. 예를 들면 다음과 같습니다.
array<int, 4> ai = { 1, 2, 3 };
creates the object ai that holds four integer values, initializes the first three elements to the values 1, 2, and 3, respectively, and initializes the fourth element to 0.
요구 사항
Header: <array>
네임스페이스: std