[temp.constr.normal] (original) (raw)
[Example 4: template<typename T> concept A = true;template<typename T> concept B = A<T> && true; template<typename T> concept C = true;template<typename T> concept D = C<T> && true; template<typename T, template<typename> concept... CTs> concept all_of = (CTs<T> && ...);template<typename T> requires all_of<T, A, C> constexpr int f(T) { return 1; } template<typename T> requires all_of<T, B, D> constexpr int f(T) { return 2; } static_assert(f(1) == 2);
The normal form of all_of<T, A, C> is the conjunction of the normal forms of A<T> and C<T>.
Similarly, the normal form of all_of<T, B, D> is the conjunction of the normal forms of B<T> and D<T>.
#2 therefore is more constrained than #1.
— _end example_]
[Example 5: template<typename T, template<typename> concept> struct wrapper {};template<typename... T, template<typename> concept... CTs> int f(wrapper<T, CTs>...) requires (CTs<T> && ...); — _end example_]