copy-ctor's
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Mon May 27 02:54:54 UTC 2019
On Monday, 27 May 2019 at 00:41:22 UTC, Manu wrote:
> Well I'm obviously implementing a tagged union.
> The language just needs to make the feature available, and let
> me wrap it up.
IIRC Bearophile suggested that the struct could provide a
function or some mechanism that would tell the runtime what type
the union contained. But Andrei didn't like it.
Some sort of "type-switch" statement in the union with a
conditional that is allowed to reference fields in the
surrounding struct would be a possibility.
The real problem isn't that one cannot come up with a decent
solution, but that the semantics of C has been subsumed, and
extended.
More information about the Digitalmars-d
mailing list