C++ Logo

std-discussion

Advanced search

Re: Contradiction in the description of the pack expansion

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Fri, 16 Aug 2019 18:19:29 +0300
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.

Received on 2019-08-16 10:21:42