C++ Logo


Advanced search

Re: Optional Semicolons

From: Lénárd Szolnoki <cpp_at_[hidden]>
Date: Thu, 28 Apr 2022 19:23:21 +0100

I would like to add that this is an existing line break style. Some people like it, because the operator is visually close to both of the operands, and it's at a consistent place. clang-format also has an option for this (although somewhat broken).

It's especially nice that it can be easily parsed that the statement continues on the next line, because of the missing semicolon.


On 28 April 2022 18:20:53 BST, Christof Meerwald via Std-Discussion <std-discussion_at_[hidden]> wrote:
>On Thu, Apr 28, 2022 at 01:11:36PM -0400, William Linkmeyer via Std-Discussion wrote:
>> I’ve been considering writing a paper which allows the programmer to elide semicolons when the statement is otherwise followed by any number of whitespace and a newline.
>so something like
> a = b
> + c;
>now changes meaning?
>https://cmeerw.org sip:cmeerw at cmeerw.org
>mailto:cmeerw at cmeerw.org xmpp:cmeerw at cmeerw.org
>Std-Discussion mailing list

Received on 2022-04-28 18:23:27