AssociativeContainer<IndexType, ItemType>::Begin
Iterator Begin (void);
ConstIterator Begin (void) const;
리턴 값
설명
반복자 디레퍼런싱을 통해 획득한 항목들에 대한 레퍼런스들은 부모 연관 컨테이너 상에서 다음 변경하기 메소드가 호출될 때까지만 사용할 수 있습니다.
이 메소드는 Enumerate 메소드와 같습니다.
예제
GS::HashTable<GS::String, long> hashTable; // {strings, long} pair들의 hashtable GS::AssociativeContainer<GS::String, long>& associativeContainer = hashTable; // {string, long} pair들의 연관 컨테이너 (hashTable을 참조함) GS::AssociativeContainer<GS::String, long>::Iterator begin = associativeContainer.Begin (); // 1번째 항목을 참조하는 반복자 획득하기 GS::AssociativeContainer<GS::String, long>::Iterator end = associativeContainer.End (); // 마지막 직전 항목을 참조하는 반복자 획득하기 while (begin != end) { // 시퀀스 끝까지 (연관 컨테이너) long l = *begin; // 반복자 디레퍼런싱 (레퍼런스를 리턴함) ++begin; // 다음 항목으로 전진 }
이 예제는 연관 컨테이너로부터 획득한 항목 반복자들의 사용법을 설명합니다.