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.