diff options
-rw-r--r-- | main-window/mixin-traits.cpp | 6 | ||||
-rw-r--r-- | main-window/mixin-traits.hpp | 21 |
2 files changed, 5 insertions, 22 deletions
diff --git a/main-window/mixin-traits.cpp b/main-window/mixin-traits.cpp index a374eade..ea8e9bc8 100644 --- a/main-window/mixin-traits.cpp +++ b/main-window/mixin-traits.cpp @@ -1,9 +1,9 @@ -#define MIXIN_TRAIT_TESTS +//#define MIXIN_TRAIT_TESTS #ifdef MIXIN_TRAIT_TESTS # include "mixin-traits.hpp" -//namespace mixins::traits_detail { +namespace mixins::traits_detail { struct A {}; struct B : A {}; @@ -33,6 +33,6 @@ void test1() impl<A> ok2; } -//} // ns mixins::traits_detail +} // ns mixins::traits_detail #endif diff --git a/main-window/mixin-traits.hpp b/main-window/mixin-traits.hpp index 07eec98d..84a64d08 100644 --- a/main-window/mixin-traits.hpp +++ b/main-window/mixin-traits.hpp @@ -6,7 +6,7 @@ #include <type_traits> -//namespace mixins::traits_detail { +namespace mixins::traits_detail { using namespace meta; template<typename... xs> @@ -39,27 +39,10 @@ using type = std::bool_constant<b1::value && b2::value && b3::value>; }; -#if 0 - template<typename final_class, typename t> - static constexpr void check_depends_recursively() - { - std::is_base_of_v<x, final_class> && - assert_depends<final_class, xs...>::check_depends() - - using depends = typename mixin_traits<t>::depends; - static_assert(lift<assert_depends, cons<t, depends>>::check_depends()); - - using car = first<depends>; - using cdr = rest<depends>; - - check_depends_recursively<car>(); - } -#endif - template<typename t> class impl { using t1 = typename lift<check_depends_, cons<t, typename mixin_traits<t>::depends>>::type; static_assert(t1::value); }; -//} // ns mixins::traits_detail +} // ns mixins::traits_detail |