pydongery / blog

MIT License
0 stars 0 forks source link

Implementing std::variant #8

Open Tsche opened 2 months ago

Tsche commented 2 months ago

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.