:
template<typename T> concept C1 = requires(T x) {
{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;
};
—
end example