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

1.8 KiB

[expr.prim.req.nested]

7 Expressions [expr]

7.5 Primary expressions [expr.prim]

7.5.8 Requires expressions [expr.prim.req]

7.5.8.5 Nested requirements [expr.prim.req.nested]

nested-requirement:
requires constraint-expression ;

1

#

A nested-requirement can be used to specify additional constraints in terms of local parameters.

The constraint-expression shall be satisfied ([temp.constr.decl]) by the substituted template arguments, if any.

Substitution of template arguments into a nested-requirement does not result in substitution into the constraint-expression other than as specified in [temp.constr.constr].

[Example 1:

template concept C = sizeof(U) == 1;

template concept D = requires (T t) {requires C<decltype (+t)>;};D is satisfied if sizeof(decltype (+t)) == 1 ([temp.constr.atomic]).

— end example]