Discussion Thread: DIP 1037--Add Unary Operator ...--Community Review Round 1

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Wed Oct 28 15:25:18 UTC 2020


On Wednesday, 28 October 2020 at 15:05:19 UTC, Paul Backus wrote:
> You can add an initial value outside of the fold expression:
>
>     false || Tup == 10 || ...

Ok, but the problem is in generic code. You could adopt init as 
the initial value for fold, but it fails miserably for floats as 
they don't have 0 as the init, but NaN...

Will it work with overloads so that the initial value can be a 
completely different type? (If you want to trap empty tuples, but 
have no unused value.)



More information about the Digitalmars-d mailing list