In each case,
op is the
fold-operator,
N is the number of elements in the pack expansion parameters,
and each
Ei is generated by instantiating the pattern
and replacing each pack expansion parameter with its
ith element
. For a binary fold-expression,
E is generated
by instantiating the
cast-expression
that did not contain an unexpanded pack
. [
Example 7:
template<typename ...Args>
bool all(Args ...args) { return (... && args); }
bool b = all(true, true, true, false);
Within the instantiation of
all,
the returned expression expands to
((true && true) && true) && false,
which evaluates to
false. —
end example]
If
N is zero for a unary fold-expression,
the value of the expression is shown in Table
17;
if the operator is not listed in Table
17,
the instantiation is ill-formed
.