- Added removal
- Added indexing support
This commit is contained in:
Tristan B. Velloza Kildaire 2024-04-26 16:35:21 +02:00
parent 11fd2f856e
commit 4a431c43d1
1 changed files with 15 additions and 5 deletions

View File

@ -830,15 +830,25 @@ public class Tree(T)
} }
} }
// if(found) if(found)
// { {
// this.children = this.children.removeResize(idx, true, true); this.children = this.children.removeResize(idx);
// return true; return true;
// } }
return false; return false;
} }
public T opIndex(size_t idx)
{
return idx < this.children.length ? this.children[idx].getValue() : T.init;
}
public T getValue()
{
return this.value;
}
public T[] dfs public T[] dfs
( (
InclusionStratergy!(T) strat = toDelegate(&Always!(T)), InclusionStratergy!(T) strat = toDelegate(&Always!(T)),