Blog post about different implementation approaches for variant-like types. The recursive underlying union type can be reordered as a tree to limit maximum recursion depth for type retrieval. Also, fold expressions can be used to express visitation nicely and have most compilers emit a jump table if possible.
Blog post about different implementation approaches for variant-like types. The recursive underlying union type can be reordered as a tree to limit maximum recursion depth for type retrieval. Also, fold expressions can be used to express visitation nicely and have most compilers emit a jump table if possible.