std.sumtype nested SumTypes

NonNull non-null at use.startmail.com
Sat Jan 27 00:26:11 UTC 2024


On Monday, 22 January 2024 at 21:36:47 UTC, Paul Backus wrote:
> SumType does not do this automatically (because sometimes you 
> might want to keep the inner SumTypes separate), but you can do 
> it yourself like this:
>
>     alias A = SumType!(X, Y);
>     alias B = SumType!(Z, W);
>     alias C = SumType!(A.Types, B.Types);

Very nice!


More information about the Digitalmars-d-learn mailing list