How to create option type over std.sumtype ?
enum None;
struct Some(T) { T x; }
alias Option = SumType!(Some!T, None);
I get
Error: undefined identifier T
Thread overview | ||||||
---|---|---|---|---|---|---|
|
June 29, 2023 std.sumtyp and option ? | ||||
---|---|---|---|---|
| ||||
How to create option type over std.sumtype ?
I get |
June 29, 2023 Re: std.sumtyp and option ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to kiriakov | On Thursday, 29 June 2023 at 14:18:05 UTC, kiriakov wrote: >How to create option type over std.sumtype ?
I get Looks like you meant to type
Unfortunately, due to issue 1807, this is not a good way to define an
To work around this issue, you should define your option type as a
If I use this version of |
June 29, 2023 Re: std.sumtyp and option ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to kiriakov | On Thursday, 29 June 2023 at 14:18:05 UTC, kiriakov wrote: >How to create option type over std.sumtype ?
I get Try
Your version of |
June 29, 2023 Re: std.sumtyp and option ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paul Backus | On Thursday, 29 June 2023 at 15:19:45 UTC, Paul Backus wrote: >On Thursday, 29 June 2023 at 14:18:05 UTC, kiriakov wrote: >
Thanks, it's worked. |