다음을 통해 공유


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

설명

array::const_iterator

제어되는 시퀀스에 대한 상수 반복기의 형식입니다.

array::const_pointer

요소에 대한 상수 포인터의 형식입니다.

array::const_reference

요소에 대한 상수 참조의 형식입니다.

array::const_reverse_iterator

The type of a constant reverse iterator for the controlled sequence.

array::difference_type

두 요소 사이의 부호가 있는 거리의 형식입니다.

array::iterator

제어되는 시퀀스에 대한 반복기의 형식입니다.

array::pointer

요소에 대한 포인터의 형식입니다.

array::reference

요소에 대한 참조의 형식입니다.

array::reverse_iterator

The type of a reverse iterator for the controlled sequence.

array::size_type

두 요소 사이의 부호가 없는 거리의 형식입니다.

array::value_type

요소의 형식입니다.

Member Function

설명

array::array

Constructs an array object.

array::assign

Replaces all elements.

array::at

Accesses an element at a specified position.

array::back

Accesses the last element.

array::begin

제어되는 시퀀스의 시작을 지정합니다.

array::cbegin

Returns a random-access const iterator to the first element in the array.

array::cend

Returns a random-access const iterator that points just beyond the end of the array.

array::crbegin

Returns a const iterator to the first element in a reversed array.

array::crend

Returns a const iterator to the end of a reversed array.

array::data

Gets the address of the first element.

array::empty

Tests whether elements are present.

array::end

제어되는 시퀀스의 끝을 지정합니다.

array::fill

Replaces all elements with a specified value.

array::front

Accesses the first element.

array::max_size

요소의 수를 셉니다.

array::rbegin

역방향 제어되는 시퀀스의 시작을 지정합니다.

array::rend

역방향 제어되는 시퀀스의 끝을 지정합니다.

array::size

요소의 수를 셉니다.

array::swap

두 컨테이너의 내용을 바꿉니다.

연산자

설명

array::operator=

Replaces the controlled sequence.

array::operator[]

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

참고 항목

참조

<array>