You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An init-capture pack is a lambda capture that introduces an init-capture for each of the elements in the pack expansion of its initializer.
[temp.variadic] p4
The number of elements of an init-capture pack is the number of elements in the pack expansion of its initializer.
So, what does "pack expansion of its initializer" mean? We just define that
A pack expansion consists of a pattern and an ellipsis, ...
A pack whose name appears within the pattern of a pack expansion is expanded by that pack expansion.
In a capture-list ([expr.prim.lambda.capture]); the pattern is the capture without the ellipsis.
For example
template <typename... Args>
voidfoo(Args... args) {
[...xs=args]{
bar(xs...); // xs is an init-capture pack
};
}
...xs=args is a pack expansion where xs=args is the pattern, we say the pack args is expanded by this pack expansion; =args is the initializer in the init-capture pack. We never define "pack expansion of its initializer". This utterance is obscure in the current draft. Since we say:
A pack expansion consists of a pattern and an ellipsis, the instantiation of which produces zero or more instantiations of the pattern in a list (described below).
thus, shouldn't we say
An init-capture pack is a lambda capture that introduces an init-capture for each of the elements that resulted from the instantiation of the init-capture that declares it.
?
As well as
The number of elements of an init-capture pack is the number of elements that resulted from the instantiation of its pack expansion.
The text was updated successfully, but these errors were encountered:
[temp.variadic] p3
[temp.variadic] p4
So, what does "pack expansion of its initializer" mean? We just define that
For example
...xs=args
is a pack expansion wherexs=args
is the pattern, we say the packargs
is expanded by this pack expansion;=args
is the initializer in the init-capture pack. We never define "pack expansion of its initializer". This utterance is obscure in the current draft. Since we say:thus, shouldn't we say
?
As well as
The text was updated successfully, but these errors were encountered: