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:30:44 +0300
On Fri, 16 Aug 2019 at 18:23, Brian Bi <bbi5291_at_[hidden]> wrote:
>> > 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.
> That's not what the plain text of the standard says (C++17 [temp.variadic]/4):
>> Pack expansions can occur in the following contexts: ... In a capture-list (8.1.5); the pattern is a capture.

And you're quite sure that doesn't mean something like this?:

template <class... Args> void f(Args&&... args) {
    [args...](){};
}

Received on 2019-08-16 10:32:57