Udostępnij za pośrednictwem


CAtlList::AddHeadList

Call this method to add an existing list to the head of the list.

void AddHeadList(
   const CAtlList< E, ETraits >* plNew 
);

Parameters

  • plNew
    The list to be added.

Remarks

The list pointed to by plNew is inserted at the start of the existing list. In debug builds, an assertion failure will occur if plNew is equal to NULL.

Example

// Define two lists of integers
CAtlList<int> myList1;
CAtlList<int> myList2;

// Fill up the first list
myList1.AddTail(1);
myList1.AddTail(2);
myList1.AddTail(3);

// Add an element to the second list
myList2.AddTail(4);

// Insert the first list into the second
myList2.AddHeadList(&myList1);

// The second list now contains:
// 1, 2, 3, 4   

Requirements

Header: atlcoll.h

See Also

Reference

CAtlList Class

CAtlList::AddHead

CAtlList::AddTailList

Other Resources

CAtlList Members