deque::operator (STL/CLR)
지정 된 위치에 있는 요소에 액세스합니다.
reference operator[](size_type pos);
매개 변수
- pos
액세스할 요소의 위치입니다.
설명
멤버 연산자를 referene 위치에 있는 요소를 반환 pos.이 위치 정보를 알 수 있는 요소에 액세스할 수 있습니다.
예제
// cliext_deque_operator_sub.cpp
// compile with: /clr
#include <cliext/deque>
int main()
{
cliext::deque<wchar_t> c1;
c1.push_back(L'a');
c1.push_back(L'b');
c1.push_back(L'c');
// display contents " a b c" using subscripting
for (int i = 0; i < c1.size(); ++i)
System::Console::Write(" {0}", c1[i]);
System::Console::WriteLine();
// change an entry and redisplay
c1[1] = L'x';
for (int i = 0; i < c1.size(); ++i)
System::Console::Write(" {0}", c1[i]);
System::Console::WriteLine();
return (0);
}
요구 사항
헤더: < cliext/있지 않은 deque >
네임 스페이스: cliext