std.sumtype?

Oleg B code.viator at gmail.com
Thu Mar 18 17:24:13 UTC 2021


On Thursday, 18 March 2021 at 16:48:01 UTC, Paul Backus wrote:
> Because I personally haven't needed it for anything, and nobody 
> else has presented me with a convincing use-case for it until 
> now.
>
> In general, it is much, much easier to add new features than to 
> remove existing ones, so I try to put off adding a feature 
> until I am absolutely sure it is the right decision.

Adding read-only tag is simple and useful change. If I understand 
code correctly tag is direct index of val.Types, it's right?

May be depending on order of types must be fixed too

```
alias S1 = Sumtype!(int, float);
alias S2 = Sumtype!(float, int);

static assert (is(S1 == S2)); // false by now
```
because no different between S1 and S2 in practice use


More information about the Digitalmars-d mailing list