diff --git a/sdk/lib/atl/atlcoll.h b/sdk/lib/atl/atlcoll.h index 1068deeacc5..8351a3a6f56 100644 --- a/sdk/lib/atl/atlcoll.h +++ b/sdk/lib/atl/atlcoll.h @@ -480,6 +480,9 @@ public: POSITION AddHead(INARGTYPE element); POSITION AddTail(INARGTYPE element); + void AddHeadList(_In_ const CAtlList* plNew); + void AddTailList(_In_ const CAtlList* plNew); + E RemoveHead(); E RemoveTail(); @@ -639,6 +642,24 @@ POSITION CAtlList::AddTail(INARGTYPE element) return (POSITION)Node; } +template +void CAtlList::AddHeadList(_In_ const CAtlList* plNew) +{ + ATLASSERT(plNew != NULL && plNew != this); + POSITION pos = plNew->GetTailPosition(); + while (pos) + AddHead(plNew->GetPrev(pos)); +} + +template +void CAtlList::AddTailList(_In_ const CAtlList* plNew) +{ + ATLASSERT(plNew != NULL && plNew != this); + POSITION pos = plNew->GetHeadPosition(); + while (pos) + AddTail(plNew->GetNext(pos)); +} + template E CAtlList::RemoveHead() {