C++ Logo


Advanced search

Re: [std-proposals] The Oxford variadic comma

From: Arthur O'Dwyer <arthur.j.odwyer_at_[hidden]>
Date: Wed, 28 Feb 2024 08:48:11 -0500
On Wed, Feb 28, 2024 at 7:17 AM Jan Schultke via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> I have drafted another C++ proposal:
> https://eisenwave.github.io/cpp-proposals/oxford-variadic-comma.html

I like this a lot!
Nits and comments:

Abstract: "This proposal seeks to..." — You can cut those words; just
"Deprecate ellipsis parameters without..." gets right to the point.
*"Erin, when you recount your day, never say you woke up. It's a waste of
your time."*

"proposed to make" — maybe "also proposed to make"? Maybe even say what the
first part of that proposal was, so that when later you talk about "the
latter part" it's clearer what you mean? I assume P1219 proposed to permit
`int...` to mean "a pack of ints", *and also* proposed to make the
separating comma prior to an ellipsis mandatory. EWGI liked this *latter*

`class T...` should be `class... T`, and also please rename `T` to `Ts`
("packs should be plural").

The C-compatibility section is very important and good and also news to me.
Are you saying that `int f(int x ...)` has *never* been valid C, all the
way back to C89? That should be the above-the-fold headline! Maybe even
include "The deprecated syntax has never been valid C" in the Abstract, if
it's a true statement. (OTOH if that would be a false statement, then this
section would have led me to believe something false, and so it would help
to talk about e.g. "C99" or "C11" instead of "C".)

FWIW, I haven't heard "abominable pack" before (and neither has Google). I
suggest that if you're telling the reader about a fun term you learned, you
give a hyperlink to the source; and if you're telling the reader a fun term
you invented, you don't bother introducing the term here (because this is
its only usage, and you're deprecating it — it doesn't need a fun name).

The second Note in that section seems wrong to me; I'd like to see an
example. Off the top of my head, I don't think explicit template arguments
would help here. But OTOH, this would be fine:
  template<class... Ts>
  struct S {
    static int f(Ts..., ...);
  int i = S<int, int>::f(1, 2, 3, 4); // pack is (1,2), varargs are (3,4)

Anyway, looks like a well-crafted and long-overdue proposal!


> Please share your thoughts :)
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2024-02-28 13:48:25