145
|
1 // { dg-do compile { target c++2a } }
|
|
2 // { dg-additional-options "-fconcepts-ts" }
|
|
3 template <class, class>
|
|
4 class NumericArray {};
|
|
5
|
|
6 template <class>
|
|
7 constexpr bool match_numeric_array = false;
|
|
8 template <class Scalar, class Shape>
|
|
9 constexpr bool
|
|
10 match_numeric_array<NumericArray<Scalar, Shape>> =
|
|
11 true;
|
|
12 template <class T>
|
|
13 concept bool cpt_NumericArrayContainer() {
|
|
14 return match_numeric_array<T>;
|
|
15 }
|
|
16
|
|
17 template <class X>
|
|
18 concept bool cpt_NumericArray() {
|
|
19 return requires{requires cpt_NumericArrayContainer<X>();};
|
|
20 }
|
|
21
|
|
22
|
|
23 template <class X>
|
|
24 requires !cpt_NumericArray<X>() auto func(int, X) {}
|
|
25
|
|
26 template <class X>
|
|
27 requires cpt_NumericArray<X>() auto func(int, X) {}
|
|
28
|
|
29 int main() {
|
|
30 NumericArray<double, int> v5;
|
|
31 func(0, v5);
|
|
32 }
|