7 Expressions [expr]

7.5 Primary expressions [expr.prim]

7.5.7 Requires expressions [expr.prim.req] Compound requirements [expr.prim.req.compound]

	{ expression } noexcept return-type-requirement ;
	-> 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:
template<typename T> concept C1 = requires(T 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