CList::GetTail

Gets the CObject pointer that represents the tail element of this list.

TYPE& GetTail( );
const TYPE& GetTail() const;

Parameters

  • TYPE
    Template parameter specifying the type of elements in the list.

Return Value

See the return value description for GetHead.

Remarks

You must ensure that the list is not empty before calling GetTail. If the list is empty, then the Debug version of the Microsoft Foundation Class Library asserts. Use IsEmpty to verify that the list contains elements.

Example

// Define myList.
CList<CString,CString&> myList;

// Add an element to the end of the list.
myList.AddTail(CString(_T("ABC")));

// Verify the element was added to the end of the list.
ASSERT(CString(_T("ABC")) == myList.GetTail());

Requirements

Header: afxtempl.h

See Also

Reference

CList Class

Hierarchy Chart

CList::AddTail

CList::AddHead

CList::RemoveHead

CList::GetHead

Other Resources

CList Members