C++ Logo

STD-DISCUSSION

Advanced search

Subject: Re: Contradiction in the description of the pack expansion
From: Language Lawyer (language.lawyer_at_[hidden])
Date: 2019-08-16 10:23:47


On 16/08/2019 18:19, Ville Voutilainen via Std-Discussion wrote:
> On Fri, 16 Aug 2019 at 17:52, Brian Bi via Std-Discussion
> <std-discussion_at_[hidden]> wrote:
>> Which pack expansion in this example does not use an ellipsis?
>> There are two pack expansions here: `...xs=args` where the pattern is `xs=args`,
>
> That's not a pack expansion. It's a declaration of a captured pack,
> initialized from another pack. It does not
> and should not use a trailing ellipsis.
>
>> and also in `bar(xs...)`, `xs...` is a pack expansion. Both use an ellipsis.
>
> That one is fine, yes.
>
>> The `sizeof...` operator also contains an ellipsis. It just happens that the ellipsis is not adjacent to the pack.
>
> It contains an ellipsis but it's not a pack expansion.
>

"A sizeof... expression is a pack expansion" (http://eel.is/c++draft/expr.sizeof#4.sentence-3) is a lie?


STD-DISCUSSION list run by herb.sutter at gmail.com

Older Archives on Google Groups