RFC: std.sumtype (adding sumtype to Phobos)

Paul Backus snarwin at gmail.com
Wed Nov 25 16:12:14 UTC 2020


On Wednesday, 25 November 2020 at 15:50:47 UTC, bachmeier wrote:
>
> The "Basic Usage" examples show functions preceded by "pure 
> @safe @nogc nothrow". Is that required? If so, do we want to go 
> down the path of adding that kind of verbosity/complexity to 
> Phobos libraries? That would be a substantial change from what 
> we have now. It would definitely make the language less 
> appealing (particularly with two starting with @ and two not).

No, the attributes are not required. They're just there to show 
that SumType *can* be used in @safe/pure/nothrow/@nogc code, if 
desired. Maybe it's better to leave them off, though, if they're 
distracting readers from the main topic of the example.


More information about the Digitalmars-d mailing list