mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[ATL] Implement CAtlList::AddHeadList and CAtlList::AddTailList
What about a convenient way to append CAtlList to each other?
This commit is contained in:
parent
d3ec7cdd48
commit
103d84448f
1 changed files with 21 additions and 0 deletions
|
@ -480,6 +480,9 @@ public:
|
|||
POSITION AddHead(INARGTYPE element);
|
||||
POSITION AddTail(INARGTYPE element);
|
||||
|
||||
void AddHeadList(_In_ const CAtlList<E, ETraits>* plNew);
|
||||
void AddTailList(_In_ const CAtlList<E, ETraits>* plNew);
|
||||
|
||||
E RemoveHead();
|
||||
E RemoveTail();
|
||||
|
||||
|
@ -639,6 +642,24 @@ POSITION CAtlList<E, ETraits>::AddTail(INARGTYPE element)
|
|||
return (POSITION)Node;
|
||||
}
|
||||
|
||||
template <typename E, class ETraits>
|
||||
void CAtlList<E, ETraits>::AddHeadList(_In_ const CAtlList<E, ETraits>* plNew)
|
||||
{
|
||||
ATLASSERT(plNew != NULL && plNew != this);
|
||||
POSITION pos = plNew->GetTailPosition();
|
||||
while (pos)
|
||||
AddHead(plNew->GetPrev(pos));
|
||||
}
|
||||
|
||||
template <typename E, class ETraits>
|
||||
void CAtlList<E, ETraits>::AddTailList(_In_ const CAtlList<E, ETraits>* plNew)
|
||||
{
|
||||
ATLASSERT(plNew != NULL && plNew != this);
|
||||
POSITION pos = plNew->GetHeadPosition();
|
||||
while (pos)
|
||||
AddTail(plNew->GetNext(pos));
|
||||
}
|
||||
|
||||
template<typename E, class ETraits>
|
||||
E CAtlList<E, ETraits>::RemoveHead()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue