7 Expressions [expr]

7.5 Primary expressions [expr.prim]

7.5.7 Requires expressions [expr.prim.req]

7.5.7.3 Compound requirements [expr.prim.req.compound]

compound-requirement:
	{ expression } noexcept return-type-requirement ;
return-type-requirement:
	trailing-return-type
	-> cv-qualifier-seq constrained-parameter cv-qualifier-seq abstract-declarator
A compound-requirement asserts properties of the expression E.
Substitution of template arguments (if any) and verification of semantic properties proceed in the following order:
[Example
:
template<typename T> concept C1 = requires(T x) {
  {x++};
};
The compound-requirement in C1 requires that x++ is a valid expression.
It is equivalent to the simple-requirement x++;.
template<typename T> concept C2 = requires(T x) {
  {*x} -> typename T::inner;
};
The compound-requirement in C2 requires that *x is a valid expression, that typename T::inner is a valid type, and that *x is implicitly convertible to typename T::inner.
template<typename T, typename U> concept C3 = requires (T t, U u) {
  t == u;
};
template<typename T> concept C4 = requires(T x) {
  {*x} -> C3<int> const&;
};
The compound-requirement requires that *x be deduced as an argument for the invented function:
template<C3<int> X> void f(X const&);
In this case, deduction only succeeds if an expression of the type deduced for X can be compared to an int with the == operator.
template<typename T> concept C5 =
  requires(T x) {
    {g(x)} noexcept;
  };
The compound-requirement in C5 requires that g(x) is a valid expression and that g(x) is non-throwing.
end example
]