mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
bazaar: Tree: Moveable and Iteration
git-svn-id: svn://ultimatepp.org/upp/trunk@2833 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
4846ffceec
commit
64493583f2
1 changed files with 5 additions and 1 deletions
|
|
@ -6,7 +6,7 @@ using namespace Upp;
|
|||
|
||||
template <class T>
|
||||
class Tree
|
||||
: protected Array<T>
|
||||
: protected Array<T>, Moveable<Tree<T> >
|
||||
{
|
||||
protected:
|
||||
typedef Array<T> B;
|
||||
|
|
@ -63,6 +63,10 @@ public:
|
|||
|
||||
T *PopDetach() { T * t = B::PopDetach(); Unlink(*t); return t; }
|
||||
|
||||
using B::Begin;
|
||||
using B::End;
|
||||
using B::GetIter;
|
||||
|
||||
void Swap(Tree& b) { B::Swap(b); for(int i = 0; i < B::GetCount(); i++) Link(B::operator[](i)); for(int i = 0; i < b.GetCount(); i++) b.Link(b[i]); }
|
||||
|
||||
Tree& operator<<(const T& x) { Add(x); return *this; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue