다음을 통해 공유


CAtlList::MoveToHead

머리의 목록에 지정 된 요소를 이동 하려면이 메서드를 호출 합니다.

void MoveToHead(
   POSITION pos 
) throw( );

매개 변수

  • pos
    이동할 요소의 위치 값입니다.

설명

현재 위치에서 지정 된 요소 목록의 헤드를 이동 합니다.디버그 빌드에서 어설션 오류가 발생 합니다 pos null입니다.

예제

// Define the integer list
CAtlList<int> myList;

// Populate the list
myList.AddTail(1);
myList.AddTail(2);
myList.AddTail(3);
myList.AddTail(4);

// Move the tail element to the head
myList.MoveToHead(myList.GetTailPosition());

// Confirm the head is as expected
ATLASSERT(myList.GetHead() == 4);

// Move the head element to the tail
myList.MoveToTail(myList.GetHeadPosition());

// Confirm the tail is as expected
ATLASSERT(myList.GetTail() == 4);   

요구 사항

헤더: atlcoll.h

참고 항목

참조

CAtlList 클래스

CAtlList::MoveToTail

CAtlList::SwapElements