C++ Logo

std-proposals

Advanced search

Re: [std-proposals] if !(condition)

From: Bo Persson <bo_at_[hidden]>
Date: Sat, 20 Apr 2024 19:16:05 +0200
On 2024-04-20 at 18:31, Jan Schultke via Std-Proposals wrote:
> "if not" has been proposed before and rejected, albeit with a
> different motivation:
> https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1181r0.html
>
> The main issue here is whether it should behave exactly as if the
> parentheses were omitted, or whether it should behave like "if (...)
> {} else { ... }".

It can also be argued that when you have an else-part, you can just swap
the two { }-parts, and don't need a negation.

Received on 2024-04-20 17:16:16