Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[temp.variadic] "instantiation of the init-capture pack" vs. "instantiation of the init-capture pack declaration" #6211

Closed
xmh0511 opened this issue Mar 28, 2023 · 0 comments · Fixed by #6216

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Mar 28, 2023

[temp.variadic] p8 says

Such an element, in the context of the instantiation, is interpreted as follows:

  • [...]
  • if the pack is a function parameter pack, the element is an id-expression designating the ith function parameter that resulted from instantiation of the function parameter pack declaration; otherwise
  • if the pack is an init-capture pack, the element is an id-expression designating the variable introduced by the ith init-capture that resulted from instantiation of the init-capture pack.

The last bullet should be similar to the second one. Each variable is introduced by the init-capture that is instantiated from init-capture pack declaration not a "init-capture pack"

The instantiation of "init-capture pack" sounds like xs... where xs is the init-capture pack. Moreover, [basic.pre] p5 says

Every name is introduced by a declaration, which is a

  • [...]
  • init-capture ([expr.prim.lambda.capture]),

[expr.prim.lambda.capture] p17 says:

An init-capture containing an ellipsis is a pack expansion that declares an init-capture pack ([temp.variadic]).
Hence, it is reasonable to say init-capture pack is introduced by its declaration.

Suggested resolution

Change the last bullet to

if the pack is an init-capture pack, the element is an id-expression designating the variable introduced by the ith init-capture that resulted from instantiation of the init-capture pack declaration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant