1 // { dg-options "-std=c++17 -fconcepts" }
3 // Performance test... This should be fast.
8 concept bool Destructible() {
9 return std::is_destructible<T>::value;
11 template<typename T, typename... Args>
12 concept bool Constructible() {
13 return Destructible<T>() && std::is_constructible<T, Args...>::value;
16 concept bool Move_constructible() {
17 return Constructible<T, T&&>();
20 concept bool Copy_constructible() {
21 return Move_constructible<T>() && Constructible<T, const T&>();
23 template<typename T, typename U>
24 concept bool Assignable() {
25 return std::is_assignable<T, U>::value;
28 concept bool Move_assignable() {
29 return Assignable<T&, T&&>();
32 concept bool Copy_assignable() {
33 return Move_assignable<T>() && Assignable<T&, const T&>();
36 concept bool Copyable() {
37 return Copy_constructible<T>() && Copy_assignable<T>();
41 concept bool C1() { return Copyable<T>(); }
43 concept bool C2() { return C1<T>(); }
45 concept bool C3() { return C2<T>(); }
47 concept bool C4() { return C3<T>(); }
49 concept bool C5() { return C4<T>(); }
51 concept bool C6() { return C5<T>(); }
53 concept bool C7() { return C6<T>(); }
55 concept bool C8() { return C7<T>(); }
57 concept bool C9() { return C8<T>(); }
59 concept bool C10() { return C9<T>(); }
61 concept bool C11() { return C10<T>(); }
70 static_assert(C11<S1>(), "");
71 static_assert(C11<S2>(), "");
72 static_assert(C11<S3>(), "");
73 static_assert(C11<S4>(), "");
74 static_assert(C11<S5>(), "");
75 static_assert(C11<S6>(), "");