summaryrefslogtreecommitdiffhomepage
path: root/main-window/mixin-traits.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main-window/mixin-traits.cpp')
-rw-r--r--main-window/mixin-traits.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/main-window/mixin-traits.cpp b/main-window/mixin-traits.cpp
new file mode 100644
index 00000000..4b34eb5b
--- /dev/null
+++ b/main-window/mixin-traits.cpp
@@ -0,0 +1,39 @@
+#pragma once
+
+#define MIXIN_TRAIT_TESTS
+
+#ifdef MIXIN_TRAIT_TESTS
+# include "mixin-traits.hpp"
+
+namespace mixins::traits_detail {
+
+struct A {};
+struct B : A {};
+struct C {};
+
+template<> struct mixin_traits<B>
+{
+ using depends = tuple<A>;
+};
+
+template<> struct mixin_traits<A>
+{
+ using depends = tuple<B>;
+};
+
+template<> struct mixin_traits<C>
+{
+ using depends = tuple<B, A>;
+};
+
+extern void test1();
+
+void test1()
+{
+ //impl<A> fail1;
+ impl<B> ok1;
+}
+
+} // ns mixins::traits_detail
+
+#endif