1 2 3 4 5 6 7 8 9 10 11 12 13 14
// { dg-do compile { target c++20 } } template<class From, class To> concept convertible_to = requires(From (&f)(), void (&g)(To)) { g(f()); }; template<class T> concept Addable = requires(T x){ {x + x} -> convertible_to<T>; }; int main(){ Addable auto t = 0; }