top | item 43793494

(no title)

grandempire | 10 months ago

No. This is how sum types are implemented.

And from a runtime perspective it’s going to be a struct with perhaps more padding. You’ll need more details about your specific threat model to explain why that’s bad.

discuss

order

mistrial9|10 months ago

a quick search says that std::variant is the modern replacement to implement your niche feature "sum types"

jlouis|10 months ago

Not a niche feature. Fundamental for any decent language with a type system.

soraminazuki|10 months ago

Whoa, that's a core building block of programming and computer science that you're dismissing as "niche" without explanation.

grandempire|10 months ago

That’s for C++. And how is std::variant implemented?