RFC: std.sumtype (adding sumtype to Phobos)

bachmeier no at spam.net
Wed Nov 25 19:16:48 UTC 2020


On Wednesday, 25 November 2020 at 18:42:09 UTC, jmh530 wrote:
> On Wednesday, 25 November 2020 at 17:53:41 UTC, bachmeier wrote:
>> [snip]
>>
>> If that's the case, I agree that it's a good thing to show. 
>> You might consider having a clean version of toFahrenheit and 
>> then something like
>>
>> // SumType can be used in @safe/pure/nothrow/@nogc code
>> pure @safe @nogc nothrow
>> void freeze(ref Temperature t)
>>
>> Whatever you do with that, it clears up my concern and I would 
>> like to see this added to Phobos.
>
> In general, if you can call a function in a block with all the 
> attributes, then you can call it without them all too, but that 
> may not be known to someone who has not made much use of them.

I didn't know that was always the case, but definitely qualify as 
someone that does not add attributes to his functions.


More information about the Digitalmars-d mailing list