CList::RemoveHead

Usuwa element z listy głowy i zwraca wskaźnik do niego.

TYPE RemoveHead( );

Parametry

  • TYP
    Parametr szablonu, określając typ elementów na liście.

Wartość zwracana

Element poprzednio na czele listy.

Uwagi

Musi zapewnić lista nie jest pusta przed wywoływaniem RemoveHead.Jeśli lista jest pusta, deklaracji rozkazujących wersji debugowania biblioteki klas Microsoft Foundation.Użyj IsEmpty , aby sprawdzić, czy lista zawiera elementy.

Przykład

// 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()));      

Wymagania

Nagłówek: afxtempl.h

Zobacz też

Informacje

Klasa CList

Diagram hierarchii

CList::GetHead

CList::AddHead