Поделиться через


CAtlList::InsertAfter

Call this method to insert a new element into the list after the specified position.

POSITION InsertAfter(
   POSITION pos,
   INARGTYPE element 
);

Параметры

  • pos
    The POSITION value after which the new element will be inserted.

  • element
    The element to be inserted.

Возвращаемое значение

Returns the POSITION value of the new element.

Заметки

In debug builds, an assertion failure will occur if the list isn't valid, if the insert fails, or if an attempt is made to insert the element after the tail.

Пример

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

// Populate the list
POSITION myPos = myList.AddHead(1);
myPos = myList.InsertAfter(myPos, 2);
myPos = myList.InsertAfter(myPos, 3);

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

Требования

Header: atlcoll.h

См. также

Основные понятия

CAtlList Class

CAtlList Members

CAtlList::InsertBefore