POSITION AddTail( ARG_TYPE newElement );
void AddTail( CList* pNewList );
Return Value
The first version returns the POSITION value of the newly inserted element.
Parameters
ARG_TYPE
Template parameter specifying the type of the list element (can be a reference).
newElement
The element to be added to this list.
pNewList
A pointer to another CList list. The elements in pNewList will be added to this list.
Remarks
Adds a new element or list of elements to the tail of this list. The list can be empty before the operation.
Example
// Define myList and myList2.
CList<CString,CString&> myList;
CList<CString,CString&> myList2;
// Add elements to the end of myList and myList2.
myList.AddTail(CString("A"));
myList.AddTail(CString("B"));
myList2.AddTail(CString("C"));
myList2.AddTail(CString("D"));
// There are two versions of CList::AddTail: one adds a single
// element to the end of the list, the second adds another list
// to the end.
// This adds the string "ABC" to the end of myList.
// myList is a list of CStrings (ie defined as CList<CString,CString&>).
myList.AddTail(CString("ABC"));
ASSERT(CString("ABC") == myList.GetTail());
// The adds the elements of myList2 to the end of myList.
myList.AddTail(&myList2);
CList Overview | Class Members | Hierarchy Chart
See Also CObList::GetTail, CObList::RemoveTail