Sdílet prostřednictvím


CList::AddHead

Přidá nový prvek nebo seznam prvků hlavy tohoto seznamu.

POSITION AddHead(
   ARG_TYPE newElement 
);
void AddHead(
   CList* pNewList 
);

Parametry

  • ARG_TYPE
    Parametr šablony určující typ prvku seznamu (může být odkaz).

  • newElement
    Nový prvek.

  • pNewList
    Ukazatel na jiné CList seznam.Prvky v pNewList budou přidány do tohoto seznamu.

Vrácená hodnota

Vrátí první verze pozice hodnotu nově vloženého prvku.

Poznámky

Tento seznam může být prázdný před operací.

Příklad

// Declarations of the variables used in the example
CList<CString,CString&> myList;
CList<CString,CString&> myList2;

// There are two versions of CList::AddHead: one adds a single
// element to the front of the list, the second adds another list
// to the front. 

// This adds the string "ABC" to the front of myList.
// myList is a list of CStrings (ie defined as CList<CString,CString&>).
myList.AddHead(CString(_T("ABC")));

// This adds the elements of myList2 to the front of myList.
myList.AddHead(&myList2);      

Požadavky

Záhlaví: afxtempl.h

Viz také

Referenční dokumentace

Třída CList

Diagram hierarchie

CList::GetHead

CList::RemoveHead