C++ Logo


Advanced search

Re: QOL: trailing comma in template arguments

From: Matthew Woehlke <mwoehlke.floss_at_[hidden]>
Date: Tue, 26 Jan 2021 08:38:25 -0500
On 26/01/2021 06.14, Ville Voutilainen via Std-Discussion wrote:
> On Tue, 26 Jan 2021 at 12:57, Jefferson Carpenter wrote:
>> On 1/26/2021 9:25 AM, Ville Voutilainen via Std-Discussion wrote:
>>> The usual feedback bit is to bring us a comprehensive package
>>> that looks at all of the cases where trailing commas should be
>>> allowed, not just a single tweak for one case where there's a
>>> comma-separated list.
>> It does seem to be not the most trivial change, since
>> template-argument-list is non-empty so the parser can just parse a
>> template-argument after the "<", and again after each ",".
> Sure, it's technically doable. But then again, why? To get nicer
> diffs? At the cost of changing every C++ parser on the planet? That's
> a *terrible* trade-off.

...and yet, it was considered worthwhile for enums.

I think the preceding comment is right; if we're going to do it, we need
to do it once and be done with the problem for all time.

FWIW, trailing commas in function argument lists might be worthwhile,
due to issues with variadic macros taking sometimes-empty argument lists.


Received on 2021-01-26 07:38:30