How to construct a tree data structure with differently static nodes types

data pulverizer data.pulverizer at gmail.com
Mon Nov 23 01:31:16 UTC 2020


On Monday, 23 November 2020 at 01:24:54 UTC, Max Haughton wrote:
>
> If you want to keep things simple, use OOP (classes).
>
> If you need to use structs, the "sumtype" may be just what you 
> need (it's a bit more lightweight than std.algebraic in the 
> standard library). If you want to implement this yourself then 
> you need to write something called a tagged union.

I'm looking for a data structure that is fully specified at 
compile time and statically dispatched rather than dynamically 
dispatched like OOP and so forth.


More information about the Digitalmars-d-learn mailing list