C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Allow comma at the end of a list of objects in a declaration or definition

From: David Brown <david_at_[hidden]>
Date: Mon, 8 May 2023 09:19:31 +0200
On 07/05/2023 19:35, Frederick Virchanza Gotham via Std-Proposals wrote:
> On Sun, May 7, 2023 at 6:33 PM Bo Persson via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
>
>> I propose that we ban commas altogether, and make you write each
>> declaration as its own line. Then the diff will show exactly the line
>> that was added:

Exactly.

>>
>> std::jthread listener;
>> std::jthread sender;
>> std::jthread monitor;
>> +std::jthread socket;
>
>
> As I mentioned in a previous post, if you then change them all from
> 'jthread' to 'thread', you have to edit all four lines.

 using xthread = std::jthread;
 xthread listener;
 xthread sennder;
 xthread monitor;

Now adding a new thread is one line. Changing the style of thread from
jthread to thread is one line. Simple, clear changes - anyone reading
your git log will thank you for it.

Received on 2023-05-08 07:19:41