summaryrefslogtreecommitdiffhomepage
path: root/main-window/mixin-traits.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-07-13 19:39:15 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-07-24 00:43:03 +0200
commit1cac120c0b6b460899add3546d013b628d6b54bc (patch)
tree45362a76b8b47e310b13a679004b1f9936ff3a87 /main-window/mixin-traits.cpp
parent3faf71a4b51c3f972593d1df8f649a4a100226ac (diff)
WIP
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