[expr.prim.fold] (original) (raw)

An expression of the form(e1 op1 ... op2 e2)where op1 and op2 are fold-operator_s_is called a binary fold.

In a binary fold,op1 and _op2_shall be the same fold-operator, and either e1shall contain an unexpanded pack or e2shall contain an unexpanded pack, but not both.

If e2 contains an unexpanded pack, the expression is called a binary left fold.

If e1 contains an unexpanded pack, the expression is called a binary right fold.

[Example 1: template<typename ...Args> bool f(Args ...args) { return (true && ... && args); } template<typename ...Args> bool f(Args ...args) { return (args + ... + args); } — _end example_]