C++ Logo


Advanced search

Two issues about the description of the instantiation of fold-expression in [temp.variadic]

From: jim x <xmh970252187_at_[hidden]>
Date: Mon, 8 Mar 2021 16:04:39 +0800
In the current draft, there are two issues about the instantiation for a
The first is the standard seems not clear for stating which are the
elements of the pack expansion parameters that appear in the pattern of
fold-expression. It could be assumed they're stated in paragraph 8
[temp.variadic#8] <https://eel.is/c++draft/temp.variadic#8>

However, such a layout of the rule seems that the description for what
these elements of pack expansion parameters are is only applying to the
case that is: `the instantiation of a pack expansion that is neither a
sizeof... expression nor a fold-expression`.

Is it necessary to take the rule out from paragraph 8 to be an individual
rule? That would cover the case that what these elements of the pack
expansion parameters are which appears in the fold-expression.

The second issue is about the **binary fold-expression** when the number of
the elements is zero. The whole paragraph 10 only talks about how the
result is for the unary fold-expression when the number of the elements is
zero. It lacks the case of a binary fold-expression. (Presumably, the
result of this case is that of the expression `E` that didn't contain an
unexpanded pack).

Received on 2021-03-08 02:04:56