From 22b1ac3f62e7c3105ff3c0f29acd973e577dd987 Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Thu, 7 Aug 2014 19:11:41 +0900 Subject: [PATCH] fix types::joint_types, types::rebind_types implementations --- sprout/type/joint_types.hpp | 249 +++++++++++++++++++++-------------- sprout/type/rebind_types.hpp | 44 ++++--- sprout/type/tuple.hpp | 72 +++++++--- 3 files changed, 232 insertions(+), 133 deletions(-) diff --git a/sprout/type/joint_types.hpp b/sprout/type/joint_types.hpp index b3525e58..de2bfb50 100644 --- a/sprout/type/joint_types.hpp +++ b/sprout/type/joint_types.hpp @@ -9,6 +9,7 @@ #define SPROUT_TYPE_JOINT_TYPES_HPP #include +#include #include #include #include @@ -38,10 +39,6 @@ namespace sprout { typename sprout::tuple_indexes::type >::type type; }; - - template - struct joint_types_default_apply; - template struct joint_types_default { public: @@ -51,16 +48,60 @@ namespace sprout { {}; }; + template + struct joint_types_default_apply; + + template< + template class TupleClass, typename... Ts, + typename Tup + > + struct joint_types_default_apply, Tup> + : public sprout::types::detail::joint_types_impl, Tup> + {}; + template< + template class TupleClass, typename... Ts, + template class TupClass, typename... Types + > + struct joint_types_default_apply, TupClass > + : public sprout::identity > + {}; + template< + template class TupleClass, typename... Ts, + template class IntSeqClass, typename Type, Type... Values + > + struct joint_types_default_apply, IntSeqClass > + : public sprout::identity...> > + {}; +#define SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(TYPE) \ + template< \ + template class TupleClass, typename... Ts, \ + template class IntSeqClass, TYPE... Values \ + > \ + struct joint_types_default_apply, IntSeqClass > \ + : public sprout::identity...> > \ + {} + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(bool); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(char); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(signed char); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(unsigned char); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(char16_t); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(char32_t); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(wchar_t); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(short); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(unsigned short); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(int); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(unsigned int); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(long); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(unsigned long); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(long long); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(unsigned long long); +#undef SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE template class TupleClass, typename... Ts> struct joint_types_default > { public: template struct apply - : public sprout::types::detail::joint_types_impl, Tup> - {}; - template class TupClass, typename... Types> - struct apply > - : public sprout::identity > + : public sprout::types::detail::joint_types_default_apply, Tup> {}; }; @@ -71,27 +112,44 @@ namespace sprout { struct joint_types_default_apply, Tup> : public sprout::types::detail::joint_types_impl, Tup> {}; + template< + template class IntegerSequenceClass, typename T, T... Vs, + template class TupClass, typename... Types + > + struct joint_types_default_apply, TupClass > + : public sprout::identity > + {}; 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 > - {}; +#define SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(TYPE) \ + template< \ + template class IntegerSequenceClass, typename T, T... Vs, \ + template class IntSeqClass, TYPE... Values \ + > \ + struct joint_types_default_apply, IntSeqClass > \ + : public sprout::identity > \ + {} + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(bool); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(char); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(signed char); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(unsigned char); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(char16_t); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(char32_t); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(wchar_t); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(short); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(unsigned short); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(int); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(unsigned int); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(long); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(unsigned long); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(long long); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(unsigned long long); +#undef SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE template class IntegerSequenceClass, typename T, T... Vs> struct joint_types_default > { public: @@ -101,79 +159,76 @@ namespace sprout { {}; }; - 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> - {}; - }; +#define SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, TYPE) \ + template< \ + template class IntegerSequenceClass, BASE... Vs, \ + template class IntSeqClass, TYPE... Values \ + > \ + struct joint_types_default_apply, IntSeqClass > \ + : public sprout::identity > \ + {} +#define SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(BASE) \ + template< \ + template class IntegerSequenceClass, BASE... Vs, \ + typename Tup \ + > \ + struct joint_types_default_apply, Tup> \ + : public sprout::types::detail::joint_types_impl, Tup> \ + {}; \ + template< \ + template class IntegerSequenceClass, BASE... Vs, \ + template class TupClass, typename... Types \ + > \ + struct joint_types_default_apply, TupClass > \ + : public sprout::identity > \ + {}; \ + template< \ + template class IntegerSequenceClass, BASE... Vs, \ + template class IntSeqClass, typename Type, Type... Values \ + > \ + struct joint_types_default_apply, IntSeqClass > \ + : public sprout::identity > \ + {}; \ + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, bool); \ + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, char); \ + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, signed char); \ + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, unsigned char); \ + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, char16_t); \ + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, char32_t); \ + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, wchar_t); \ + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, short); \ + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, unsigned short); \ + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, int); \ + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, unsigned int); \ + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, long); \ + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, unsigned long); \ + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, long long); \ + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, unsigned long long); \ + template class IntegerSequenceClass, BASE... Vs> \ + struct joint_types_default > { \ + public: \ + template \ + struct apply \ + : public sprout::types::detail::joint_types_default_apply, Tup> \ + {}; \ + } + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(bool); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(char); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(signed char); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(unsigned char); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(char16_t); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(char32_t); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(wchar_t); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(short); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(unsigned short); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(int); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(unsigned int); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(long); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(unsigned long); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(long long); + SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(unsigned long long); +#undef SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE +#undef SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL } // namespace detail // diff --git a/sprout/type/rebind_types.hpp b/sprout/type/rebind_types.hpp index 6e6c6454..f0888508 100644 --- a/sprout/type/rebind_types.hpp +++ b/sprout/type/rebind_types.hpp @@ -33,22 +33,34 @@ namespace sprout { : 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 > - {}; - }; + +#define SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(TYPE) \ + template class IndexTupleClass, TYPE... Vs> \ + struct rebind_types_default > { \ + public: \ + template \ + struct apply \ + : public sprout::identity > \ + {}; \ + } + + SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(bool); + SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(char); + SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(signed char); + SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(unsigned char); + SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(char16_t); + SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(char32_t); + SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(wchar_t); + SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(short); + SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(unsigned short); + SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(int); + SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(unsigned int); + SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(long); + SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(unsigned long); + SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(long long); + SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(unsigned long long); + +#undef SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL } // namespace detail // diff --git a/sprout/type/tuple.hpp b/sprout/type/tuple.hpp index 551a8284..6fa60f21 100644 --- a/sprout/type/tuple.hpp +++ b/sprout/type/tuple.hpp @@ -42,31 +42,47 @@ namespace sprout { // namespace detail { template - struct tuple_size_impl + struct tuple_size_default_impl : public sprout::detail::nil_base {}; template class TupleClass, typename... Ts> - struct tuple_size_impl > + struct tuple_size_default_impl > : public sprout::integral_constant {}; template class IntegerSequenceClass, typename T, T... Vs> - struct tuple_size_impl > - : public sprout::integral_constant - {}; - template class IndexTupleClass, sprout::index_t... Vs> - struct tuple_size_impl > - : public sprout::integral_constant - {}; - template class UIndexTupleClass, sprout::uindex_t... Vs> - struct tuple_size_impl > + struct tuple_size_default_impl > : public sprout::integral_constant {}; +#define SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(TYPE) \ + template class IntegerSequenceClass, TYPE... Vs> \ + struct tuple_size_default_impl > \ + : public sprout::integral_constant \ + {} + + SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(bool); + SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(char); + SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(signed char); + SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(unsigned char); + SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(char16_t); + SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(char32_t); + SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(wchar_t); + SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(short); + SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(unsigned short); + SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(int); + SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(unsigned int); + SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(long); + SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(unsigned long); + SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(long long); + SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(unsigned long long); + +#undef SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL + template >::value> struct tuple_size_default; template struct tuple_size_default - : public sprout::types::detail::tuple_size_impl + : public sprout::types::detail::tuple_size_default_impl {}; template struct tuple_size_default @@ -94,14 +110,30 @@ namespace sprout { struct tuple_element_default_impl > : public std::tuple_element...> > {}; - template class IndexTupleClass, sprout::index_t... Vs> - struct tuple_element_default_impl > - : public std::tuple_element...> > - {}; - template class UIndexTupleClass, sprout::uindex_t... Vs> - struct tuple_element_default_impl > - : public std::tuple_element...> > - {}; + +#define SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(TYPE) \ + template class IntegerSequenceClass, TYPE... Vs> \ + struct tuple_element_default_impl > \ + : public std::tuple_element...> > \ + {} + + SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(bool); + SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(char); + SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(signed char); + SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(unsigned char); + SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(char16_t); + SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(char32_t); + SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(wchar_t); + SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(short); + SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(unsigned short); + SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(int); + SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(unsigned int); + SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(long); + SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(unsigned long); + SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(long long); + SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(unsigned long long); + +#undef SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL template >::value> struct tuple_element_default;