2 // { dg-do compile { target c++23 } }
4 template<class T, class... Ts>
5 concept CartesianIndexable = requires(T t, Ts... ts) { t[ts...]; };
7 static_assert(!CartesianIndexable<int>);
8 static_assert(!CartesianIndexable<int, int>);
9 static_assert(!CartesianIndexable<int, int, int>);
11 static_assert(!CartesianIndexable<int*>);
12 static_assert(CartesianIndexable<int*, int>);
13 static_assert(!CartesianIndexable<int*, int, int>);
14 static_assert(!CartesianIndexable<int*, int*>);
18 void operator[](Ts...);
21 static_assert(!CartesianIndexable<A<>, int>);
22 static_assert(CartesianIndexable<A<int>, int>);
23 static_assert(!CartesianIndexable<A<int>>);
24 static_assert(!CartesianIndexable<A<int>, int, int>);
25 static_assert(CartesianIndexable<A<int, int>, int, int>);