2.9 KiB
[temp.constr.fold]
13 Templates [temp]
13.5 Template constraints [temp.constr]
13.5.2 Constraints [temp.constr.constr]
13.5.2.5 Fold expanded constraint [temp.constr.fold]
A fold expanded constraint is formed from a constraint C and a fold-operator which can either be && or ||.
A fold expanded constraint is a pack expansion ([temp.variadic]).
Let N be the number of elements in the pack expansion parameters ([temp.variadic]).
A fold expanded constraint whose fold-operator is && is satisfied if it is a valid pack expansion and if N=0 or if for each i where 0â¤i<N in increasing order,C is satisfied when replacing each pack expansion parameter with the corresponding ith element.
No substitution takes place for any i greater than the smallest i for which the constraint is not satisfied.
A fold expanded constraint whose fold-operator is || is satisfied if it is a valid pack expansion,N>0, and if for i where 0â¤i<N in increasing order, there is a smallest i for which C is satisfied when replacing each pack expansion parameter with the corresponding ith element.
No substitution takes place for any i greater than the smallest i for which the constraint is satisfied.
[Note 1:
If the pack expansion expands packs of different size, then it is invalid and the fold expanded constraint is not satisfied.
â end note]
Two fold expanded constraints are compatible for subsumption if their respective constraints both contain an equivalent unexpanded pack ([temp.over.link]).