mirror of
https://github.com/reactos/reactos.git
synced 2024-11-01 12:26:32 +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
|
@ -480,6 +480,9 @@ public:
|
||||||
POSITION AddHead(INARGTYPE element);
|
POSITION AddHead(INARGTYPE element);
|
||||||
POSITION AddTail(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 RemoveHead();
|
||||||
E RemoveTail();
|
E RemoveTail();
|
||||||
|
|
||||||
|
@ -639,6 +642,24 @@ POSITION CAtlList<E, ETraits>::AddTail(INARGTYPE element)
|
||||||
return (POSITION)Node;
|
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>
|
template<typename E, class ETraits>
|
||||||
E CAtlList<E, ETraits>::RemoveHead()
|
E CAtlList<E, ETraits>::RemoveHead()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue