On Tuesday, 14 January 2014 at 19:09:00 UTC, Tofu Ninja wrote:
Why are unions with pointers even allowed in the first place? It seems like a really really really bad thing to do. Am I missing some really important use case?
Tagged unions are very useful. For instance, to take a simplified, but real life example, I have a function to resolve identifier in a compiler. It can resolve as a type, as an expression, as a template, as a package or module, or whatnot. This is a case where you need to return an union of types (or rely on complete type erasure).
