Share via


CAtlList::RemoveTail

Call this method to remove the element at the tail of the list.

E RemoveTail( );

Return Value

Returns the element at the tail of the list.

Remarks

The tail element is deleted from the list, and memory is freed. A copy of the element is returned. In debug builds, an assertion failure will occur if the list is empty.

Example

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

// Populate the list
myList.AddTail(100);
myList.AddTail(200);
myList.AddTail(300);

// Confirm the tail of the list
ATLASSERT(myList.GetTail() == 300);

// Remove the tail of the list
ATLASSERT(myList.RemoveTail() == 300);

// Confirm the new tail of the list
ATLASSERT(myList.GetTail() == 200);   

Requirements

Header: atlcoll.h

See Also

Reference

CAtlList Class

CAtlList::RemoveTailNoReturn

CAtlList::RemoveHead

CAtlList::RemoveHeadNoReturn

Other Resources

CAtlList Members