Weird interaction of design choices: Duration + sum

Steven Schveighoffer schveiguy at yahoo.com
Fri Oct 13 19:24:21 UTC 2017


On 10/13/17 3:11 PM, jmh530 wrote:
> On Friday, 13 October 2017 at 18:36:58 UTC, Luís Marques wrote:
>> [snip]
> 
> What if it were package instead of private?

This wouldn't help, sum is in phobos, Duration in druntime.

The answer is that sum shouldn't be too clever. IMO, initializing to 0 
should be only done if the type's .init value doesn't match 0. Since 
only floating points and char/wchar/dchar do this, just do the Seed(0) 
for those, else use Seed.init.

-Steve


More information about the Digitalmars-d mailing list