deque::begin (STL/CLR)
제어되는 시퀀스의 시작을 지정합니다.
iterator begin();
설명
멤버 함수 제어 되는 시퀀스 또는 빈 시퀀스의 끝 바로 뒤의 첫 번째 요소를 지정 하는 임의 액세스 반복기를 반환 합니다.이를 통해 제어되는 시퀀스의 current 시작을 지정하는 반복기를 가져올 수 있지만 제어되는 시퀀스의 길이가 변경되면 상태가 변경될 수 있습니다.
예제
// cliext_deque_begin.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 initial contents " a b c"
for each (wchar_t elem in c1)
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
// inspect first two items
cliext::deque<wchar_t>::iterator it = c1.begin();
System::Console::WriteLine("*begin() = {0}", *it);
System::Console::WriteLine("*++begin() = {0}", *++it);
// alter first two items and reinspect
*--it = L'x';
*++it = L'y';
for each (wchar_t elem in c1)
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
return (0);
}
요구 사항
헤더: < cliext/있지 않은 deque >
네임 스페이스: cliext