다음을 통해 공유


CList::RemoveHead

헤드 목록에서 요소를 제거 하 고 포인터를 반환 합니다.

TYPE RemoveHead( );

매개 변수

  • 형식
    템플릿 매개 변수 목록에서 요소의 형식을 지정 합니다.

반환 값

머리의 목록에서 이전 요소입니다.

설명

목록에 전화 하기 전에 비어 있어야 RemoveHead.목록이 비어 있으면 다음 Mfc 라이브러리의 디버그 버전을 어설션 합니다.사용 IsEmpty 목록에 요소가 포함 되어 있는지 확인 합니다.

예제

// Define myList.
CList<CString,CString&> myList;

// Add two elements to the list.
myList.AddHead(CString(_T("ABC")));
myList.AddHead(CString(_T("123")));

// Remove the head element and verify the list.
// NOTE: once the head is removed, the number of
// elements in the list will be one.
CString strHead = myList.RemoveHead();
ASSERT((CString(_T("123")) == strHead) && (myList.GetCount() == 1) && 
   (CString(_T("ABC")) == myList.GetHead()));      

요구 사항

헤더: afxtempl.h

참고 항목

참조

CList 클래스

계층 구조 차트

CList::GetHead

CList::AddHead