diff --git a/sprout/type/joint_types.hpp b/sprout/type/joint_types.hpp index 7faa3c95..b3525e58 100644 --- a/sprout/type/joint_types.hpp +++ b/sprout/type/joint_types.hpp @@ -39,8 +39,18 @@ namespace sprout { >::type type; }; + template + struct joint_types_default_apply; + template - struct joint_types_default {}; + struct joint_types_default { + public: + template + struct apply + : public sprout::types::detail::joint_types_impl + {}; + }; + template class TupleClass, typename... Ts> struct joint_types_default > { public: @@ -48,21 +58,120 @@ namespace sprout { struct apply : public sprout::types::detail::joint_types_impl, Tup> {}; - template - struct apply > + template class TupClass, typename... Types> + struct apply > : public sprout::identity > {}; }; - template class ValueTupleClass, typename T, T... Vs> - struct joint_types_default > { + + template< + template class IntegerSequenceClass, typename T, T... Vs, + typename Tup + > + struct joint_types_default_apply, Tup> + : public sprout::types::detail::joint_types_impl, Tup> + {}; + template< + template class IntegerSequenceClass, typename T, T... Vs, + template class IntSeqClass, typename Type, Type... Values + > + struct joint_types_default_apply, IntSeqClass > + : public sprout::identity > + {}; + template< + template class IntegerSequenceClass, typename T, T... Vs, + template class IndexTupClass, sprout::index_t... Values + > + struct joint_types_default_apply, IndexTupClass > + : public sprout::identity > + {}; + template< + template class IntegerSequenceClass, typename T, T... Vs, + template class UIndexTupClass, sprout::uindex_t... Values + > + struct joint_types_default_apply, UIndexTupClass > + : public sprout::identity > + {}; + template class IntegerSequenceClass, typename T, T... Vs> + struct joint_types_default > { public: template struct apply - : public sprout::types::detail::joint_types_impl, Tup> + : public sprout::types::detail::joint_types_default_apply, Tup> {}; - template - struct apply > - : public sprout::identity > + }; + + template< + template class IndexTupleClass, sprout::index_t... Vs, + typename Tup + > + struct joint_types_default_apply, Tup> + : public sprout::types::detail::joint_types_impl, Tup> + {}; + template< + template class IndexTupleClass, sprout::index_t... Vs, + template class IntSeqClass, typename Type, Type... Values + > + struct joint_types_default_apply, IntSeqClass > + : public sprout::identity > + {}; + template< + template class IndexTupleClass, sprout::index_t... Vs, + template class IndexTupClass, sprout::index_t... Values + > + struct joint_types_default_apply, IndexTupClass > + : public sprout::identity > + {}; + template< + template class IndexTupleClass, sprout::index_t... Vs, + template class UIndexTupClass, sprout::uindex_t... Values + > + struct joint_types_default_apply, UIndexTupClass > + : public sprout::identity > + {}; + template class IndexTupleClass, sprout::index_t... Vs> + struct joint_types_default > { + public: + template + struct apply + : public sprout::types::detail::joint_types_default_apply, Tup> + {}; + }; + + template< + template class UIndexTupleClass, sprout::uindex_t... Vs, + typename Tup + > + struct joint_types_default_apply, Tup> + : public sprout::types::detail::joint_types_impl, Tup> + {}; + template< + template class UIndexTupleClass, sprout::uindex_t... Vs, + template class IntSeqClass, typename Type, Type... Values + > + struct joint_types_default_apply, IntSeqClass > + : public sprout::identity > + {}; + template< + template class UIndexTupleClass, sprout::uindex_t... Vs, + template class IndexTupClass, sprout::index_t... Values + > + struct joint_types_default_apply, IndexTupClass > + : public sprout::identity > + {}; + template< + template class UIndexTupleClass, sprout::uindex_t... Vs, + template class UIndexTupClass, sprout::uindex_t... Values + > + struct joint_types_default_apply, UIndexTupClass > + : public sprout::identity > + {}; + template class UIndexTupleClass, sprout::uindex_t... Vs> + struct joint_types_default > { + public: + template + struct apply + : public sprout::types::detail::joint_types_default_apply, Tup> {}; }; } // namespace detail diff --git a/sprout/type/rebind_types.hpp b/sprout/type/rebind_types.hpp index 7799c2be..6e6c6454 100644 --- a/sprout/type/rebind_types.hpp +++ b/sprout/type/rebind_types.hpp @@ -10,6 +10,7 @@ #include #include +#include namespace sprout { namespace types { @@ -24,12 +25,28 @@ namespace sprout { : public sprout::identity > {}; }; - template class ValueTupleClass, typename T, T... Vs> - struct rebind_types_default > { + template class IntegerSequenceClass, typename T, T... Vs> + struct rebind_types_default > { public: template struct apply - : public sprout::identity > + : public sprout::identity > + {}; + }; + template class IndexTupleClass, sprout::index_t... Vs> + struct rebind_types_default > { + public: + template + struct apply + : public sprout::identity > + {}; + }; + template class UIndexTupleClass, sprout::uindex_t... Vs> + struct rebind_types_default > { + public: + template + struct apply + : public sprout::identity > {}; }; } // namespace detail