Is std.variant.visit not @nogc?

aliak something at something.com
Tue Apr 10 12:34:07 UTC 2018


On Tuesday, 10 April 2018 at 03:48:25 UTC, Paul Backus wrote:
> Nope! It's just a tagged union, almost exactly the same as what 
> you'd write by hand in C. You can take a look at the source 
> yourself, if you're curious---it's actually pretty simple:
>
> https://github.com/pbackus/sumtype/blob/master/src/sumtype.d#L27

Awesome!

this is a neat trick:

union
{
   AliasSeq!(T0, T1) values;
}

Is that usage documented somewhere, or is it somewhere in phobos 
maybe?

Also, can Algebraic be fully replaced with this version then or 
is there some functionality that would stop it going through?


More information about the Digitalmars-d-learn mailing list