Any way to do a binary tree traversal without `opApply` and allocations?

Kapendev alexandroskapretsos at gmail.com
Fri Mar 27 13:40:42 UTC 2026


On Friday, 27 March 2026 at 10:15:50 UTC, monkyyy wrote:
> https://forum.dlang.org/thread/shqwthzzrrorowdqczzs@forum.dlang.org
>
> I think theres better ways to do it then this gist but 
> intrusive lists
>
> Im unsure what problems you have with the anti-work keywords, 
> but you have at least three options with what ive seen:
>
> smart handles: mixin+index, limits you to 1 array but elements 
> know where root is implictly
>
> add indexes to your types: assume the root is index 0 or 1, 
> then you should be able to generate a range from the array
>
> add an index array to your datastructure.

Can you stop copy-pasting my answers? Not nice.


More information about the Digitalmars-d-learn mailing list