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

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Oct 28 01:21:04 UTC 2020


On 10/27/20 9:17 PM, Q. Schroll wrote:
> On Tuesday, 27 October 2020 at 18:33:33 UTC, Andrei Alexandrescu wrote:
>> * "A second form shall exist which may implement a static reduce 
>> operation with the syntax expr [BinOp] ..." What happens if the tuple 
>> is empty? C++17 allows ... only in between operators, e.g.:
>>
>> return false || ... || args == value;
> 
> This is plain false information. See 
> https://en.cppreference.com/w/cpp/language/fold
> "Unary folds" are allowed for certain operators: Logical And and Or as 
> well as Comma.

Honest mistake. (FWIW the chapter I'm working on stops at C++14 and I 
just skimmed the C++17 additions.) Sorry about that, and thanks for 
straightening it out.


More information about the Digitalmars-d mailing list