Files
2025-10-25 03:02:53 +03:00

2.9 KiB
Raw Permalink Blame History

[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]

1

#

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]).

2

#

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.

3

#

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.

4

#

[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]

5

#

Two fold expanded constraints are compatible for subsumption if their respective constraints both contain an equivalent unexpanded pack ([temp.over.link]).