- 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)
// {
// this.children = this.children.removeResize(idx, true, true);
// return true;
// }
if(found)
{
this.children = this.children.removeResize(idx);
return true;
}
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
(
InclusionStratergy!(T) strat = toDelegate(&Always!(T)),