C++ Logo

STD-DISCUSSION

Advanced search

Subject: Re: Contradiction in the description of the pack expansion
From: Ville Voutilainen (ville.voutilainen_at_[hidden])
Date: 2019-08-16 10:19:29


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.


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

Older Archives on Google Groups