Udostępnij za pośrednictwem


CAtlList::MoveToHead

Wywołanie tej metody, aby przenieść określonego elementu head listy.

void MoveToHead(
   POSITION pos 
) throw( );

Parametry

  • pos
    Wartość pozycji elementu, aby przenieść.

Uwagi

Określony element jest przenoszony z bieżącej pozycji do głowy listy.W kompilacjach debugowania Błąd potwierdzenia może wystąpić w przypadku pos jest równa NULL.

Przykład

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

Wymagania

Nagłówek: atlcoll.h

Zobacz też

Informacje

Klasa CAtlList

CAtlList::MoveToTail

CAtlList::SwapElements