mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2024-11-12 21:09:01 +00:00
fix types::joint_types, types::rebind_types implementations
This commit is contained in:
parent
39bb8e8ada
commit
22b1ac3f62
3 changed files with 232 additions and 133 deletions
|
@ -9,6 +9,7 @@
|
||||||
#define SPROUT_TYPE_JOINT_TYPES_HPP
|
#define SPROUT_TYPE_JOINT_TYPES_HPP
|
||||||
|
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/type_traits/integral_constant.hpp>
|
||||||
#include <sprout/type_traits/identity.hpp>
|
#include <sprout/type_traits/identity.hpp>
|
||||||
#include <sprout/index_tuple/index_tuple.hpp>
|
#include <sprout/index_tuple/index_tuple.hpp>
|
||||||
#include <sprout/tuple/indexes.hpp>
|
#include <sprout/tuple/indexes.hpp>
|
||||||
|
@ -38,10 +39,6 @@ namespace sprout {
|
||||||
typename sprout::tuple_indexes<Tup>::type
|
typename sprout::tuple_indexes<Tup>::type
|
||||||
>::type type;
|
>::type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Tuple, typename Tup>
|
|
||||||
struct joint_types_default_apply;
|
|
||||||
|
|
||||||
template<typename Tuple>
|
template<typename Tuple>
|
||||||
struct joint_types_default {
|
struct joint_types_default {
|
||||||
public:
|
public:
|
||||||
|
@ -51,16 +48,60 @@ namespace sprout {
|
||||||
{};
|
{};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename Tuple, typename Tup>
|
||||||
|
struct joint_types_default_apply;
|
||||||
|
|
||||||
|
template<
|
||||||
|
template<typename...> class TupleClass, typename... Ts,
|
||||||
|
typename Tup
|
||||||
|
>
|
||||||
|
struct joint_types_default_apply<TupleClass<Ts...>, Tup>
|
||||||
|
: public sprout::types::detail::joint_types_impl<TupleClass<Ts...>, Tup>
|
||||||
|
{};
|
||||||
|
template<
|
||||||
|
template<typename...> class TupleClass, typename... Ts,
|
||||||
|
template<typename...> class TupClass, typename... Types
|
||||||
|
>
|
||||||
|
struct joint_types_default_apply<TupleClass<Ts...>, TupClass<Types...> >
|
||||||
|
: public sprout::identity<TupleClass<Ts..., Types...> >
|
||||||
|
{};
|
||||||
|
template<
|
||||||
|
template<typename...> class TupleClass, typename... Ts,
|
||||||
|
template<typename VType, VType...> class IntSeqClass, typename Type, Type... Values
|
||||||
|
>
|
||||||
|
struct joint_types_default_apply<TupleClass<Ts...>, IntSeqClass<Type, Values...> >
|
||||||
|
: public sprout::identity<TupleClass<Ts..., sprout::integral_constant<Type, Values>...> >
|
||||||
|
{};
|
||||||
|
#define SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_TUPLE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(TYPE) \
|
||||||
|
template< \
|
||||||
|
template<typename...> class TupleClass, typename... Ts, \
|
||||||
|
template<TYPE...> class IntSeqClass, TYPE... Values \
|
||||||
|
> \
|
||||||
|
struct joint_types_default_apply<TupleClass<Ts...>, IntSeqClass<Values...> > \
|
||||||
|
: public sprout::identity<TupleClass<Ts..., sprout::integral_constant<TYPE, Values>...> > \
|
||||||
|
{}
|
||||||
|
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<template<typename...> class TupleClass, typename... Ts>
|
template<template<typename...> class TupleClass, typename... Ts>
|
||||||
struct joint_types_default<TupleClass<Ts...> > {
|
struct joint_types_default<TupleClass<Ts...> > {
|
||||||
public:
|
public:
|
||||||
template<typename Tup>
|
template<typename Tup>
|
||||||
struct apply
|
struct apply
|
||||||
: public sprout::types::detail::joint_types_impl<TupleClass<Ts...>, Tup>
|
: public sprout::types::detail::joint_types_default_apply<TupleClass<Ts...>, Tup>
|
||||||
{};
|
|
||||||
template<template<typename...> class TupClass, typename... Types>
|
|
||||||
struct apply<TupClass<Types...> >
|
|
||||||
: public sprout::identity<TupleClass<Ts..., Types...> >
|
|
||||||
{};
|
{};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -71,6 +112,13 @@ namespace sprout {
|
||||||
struct joint_types_default_apply<IntegerSequenceClass<T, Vs...>, Tup>
|
struct joint_types_default_apply<IntegerSequenceClass<T, Vs...>, Tup>
|
||||||
: public sprout::types::detail::joint_types_impl<IntegerSequenceClass<T, Vs...>, Tup>
|
: public sprout::types::detail::joint_types_impl<IntegerSequenceClass<T, Vs...>, Tup>
|
||||||
{};
|
{};
|
||||||
|
template<
|
||||||
|
template<typename VT, VT...> class IntegerSequenceClass, typename T, T... Vs,
|
||||||
|
template<typename...> class TupClass, typename... Types
|
||||||
|
>
|
||||||
|
struct joint_types_default_apply<IntegerSequenceClass<T, Vs...>, TupClass<Types...> >
|
||||||
|
: public sprout::identity<IntegerSequenceClass<T, Vs..., Types::value...> >
|
||||||
|
{};
|
||||||
template<
|
template<
|
||||||
template<typename VT, VT...> class IntegerSequenceClass, typename T, T... Vs,
|
template<typename VT, VT...> class IntegerSequenceClass, typename T, T... Vs,
|
||||||
template<typename VType, VType...> class IntSeqClass, typename Type, Type... Values
|
template<typename VType, VType...> class IntSeqClass, typename Type, Type... Values
|
||||||
|
@ -78,20 +126,30 @@ namespace sprout {
|
||||||
struct joint_types_default_apply<IntegerSequenceClass<T, Vs...>, IntSeqClass<Type, Values...> >
|
struct joint_types_default_apply<IntegerSequenceClass<T, Vs...>, IntSeqClass<Type, Values...> >
|
||||||
: public sprout::identity<IntegerSequenceClass<T, Vs..., Values...> >
|
: public sprout::identity<IntegerSequenceClass<T, Vs..., Values...> >
|
||||||
{};
|
{};
|
||||||
template<
|
#define SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(TYPE) \
|
||||||
template<typename VT, VT...> class IntegerSequenceClass, typename T, T... Vs,
|
template< \
|
||||||
template<sprout::index_t...> class IndexTupClass, sprout::index_t... Values
|
template<typename VT, VT...> class IntegerSequenceClass, typename T, T... Vs, \
|
||||||
>
|
template<TYPE...> class IntSeqClass, TYPE... Values \
|
||||||
struct joint_types_default_apply<IntegerSequenceClass<T, Vs...>, IndexTupClass<Values...> >
|
> \
|
||||||
: public sprout::identity<IntegerSequenceClass<T, Vs..., Values...> >
|
struct joint_types_default_apply<IntegerSequenceClass<T, Vs...>, IntSeqClass<Values...> > \
|
||||||
{};
|
: public sprout::identity<IntegerSequenceClass<T, Vs..., Values...> > \
|
||||||
template<
|
{}
|
||||||
template<typename VT, VT...> class IntegerSequenceClass, typename T, T... Vs,
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(bool);
|
||||||
template<sprout::uindex_t...> class UIndexTupClass, sprout::uindex_t... Values
|
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);
|
||||||
struct joint_types_default_apply<IntegerSequenceClass<T, Vs...>, UIndexTupClass<Values...> >
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_INTEGER_SEQUENCE_LIKE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(unsigned char);
|
||||||
: public sprout::identity<IntegerSequenceClass<T, Vs..., Values...> >
|
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<template<typename VT, VT...> class IntegerSequenceClass, typename T, T... Vs>
|
template<template<typename VT, VT...> class IntegerSequenceClass, typename T, T... Vs>
|
||||||
struct joint_types_default<IntegerSequenceClass<T, Vs...> > {
|
struct joint_types_default<IntegerSequenceClass<T, Vs...> > {
|
||||||
public:
|
public:
|
||||||
|
@ -101,79 +159,76 @@ namespace sprout {
|
||||||
{};
|
{};
|
||||||
};
|
};
|
||||||
|
|
||||||
template<
|
#define SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, TYPE) \
|
||||||
template<sprout::index_t...> class IndexTupleClass, sprout::index_t... Vs,
|
template< \
|
||||||
typename Tup
|
template<BASE...> class IntegerSequenceClass, BASE... Vs, \
|
||||||
>
|
template<TYPE...> class IntSeqClass, TYPE... Values \
|
||||||
struct joint_types_default_apply<IndexTupleClass<Vs...>, Tup>
|
> \
|
||||||
: public sprout::types::detail::joint_types_impl<IndexTupleClass<Vs...>, Tup>
|
struct joint_types_default_apply<IntegerSequenceClass<Vs...>, IntSeqClass<Values...> > \
|
||||||
{};
|
: public sprout::identity<IntegerSequenceClass<Vs..., Values...> > \
|
||||||
template<
|
{}
|
||||||
template<sprout::index_t...> class IndexTupleClass, sprout::index_t... Vs,
|
#define SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(BASE) \
|
||||||
template<typename VType, VType...> class IntSeqClass, typename Type, Type... Values
|
template< \
|
||||||
>
|
template<BASE...> class IntegerSequenceClass, BASE... Vs, \
|
||||||
struct joint_types_default_apply<IndexTupleClass<Vs...>, IntSeqClass<Type, Values...> >
|
typename Tup \
|
||||||
: public sprout::identity<IndexTupleClass<Vs..., Values...> >
|
> \
|
||||||
{};
|
struct joint_types_default_apply<IntegerSequenceClass<Vs...>, Tup> \
|
||||||
template<
|
: public sprout::types::detail::joint_types_impl<IntegerSequenceClass<Vs...>, Tup> \
|
||||||
template<sprout::index_t...> class IndexTupleClass, sprout::index_t... Vs,
|
{}; \
|
||||||
template<sprout::index_t...> class IndexTupClass, sprout::index_t... Values
|
template< \
|
||||||
>
|
template<BASE...> class IntegerSequenceClass, BASE... Vs, \
|
||||||
struct joint_types_default_apply<IndexTupleClass<Vs...>, IndexTupClass<Values...> >
|
template<typename...> class TupClass, typename... Types \
|
||||||
: public sprout::identity<IndexTupleClass<Vs..., Values...> >
|
> \
|
||||||
{};
|
struct joint_types_default_apply<IntegerSequenceClass<Vs...>, TupClass<Types...> > \
|
||||||
template<
|
: public sprout::identity<IntegerSequenceClass<Vs..., Types::value...> > \
|
||||||
template<sprout::index_t...> class IndexTupleClass, sprout::index_t... Vs,
|
{}; \
|
||||||
template<sprout::uindex_t...> class UIndexTupClass, sprout::uindex_t... Values
|
template< \
|
||||||
>
|
template<BASE...> class IntegerSequenceClass, BASE... Vs, \
|
||||||
struct joint_types_default_apply<IndexTupleClass<Vs...>, UIndexTupClass<Values...> >
|
template<typename VType, VType...> class IntSeqClass, typename Type, Type... Values \
|
||||||
: public sprout::identity<IndexTupleClass<Vs..., Values...> >
|
> \
|
||||||
{};
|
struct joint_types_default_apply<IntegerSequenceClass<Vs...>, IntSeqClass<Type, Values...> > \
|
||||||
template<template<sprout::index_t...> class IndexTupleClass, sprout::index_t... Vs>
|
: public sprout::identity<IntegerSequenceClass<Vs..., Values...> > \
|
||||||
struct joint_types_default<IndexTupleClass<Vs...> > {
|
{}; \
|
||||||
public:
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, bool); \
|
||||||
template<typename Tup>
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, char); \
|
||||||
struct apply
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, signed char); \
|
||||||
: public sprout::types::detail::joint_types_default_apply<IndexTupleClass<Vs...>, Tup>
|
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); \
|
||||||
template<
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, short); \
|
||||||
template<sprout::uindex_t...> class UIndexTupleClass, sprout::uindex_t... Vs,
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, unsigned short); \
|
||||||
typename Tup
|
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); \
|
||||||
struct joint_types_default_apply<UIndexTupleClass<Vs...>, Tup>
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, long); \
|
||||||
: public sprout::types::detail::joint_types_impl<UIndexTupleClass<Vs...>, Tup>
|
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); \
|
||||||
template<
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE(BASE, unsigned long long); \
|
||||||
template<sprout::uindex_t...> class UIndexTupleClass, sprout::uindex_t... Vs,
|
template<template<BASE...> class IntegerSequenceClass, BASE... Vs> \
|
||||||
template<typename VType, VType...> class IntSeqClass, typename Type, Type... Values
|
struct joint_types_default<IntegerSequenceClass<Vs...> > { \
|
||||||
>
|
public: \
|
||||||
struct joint_types_default_apply<UIndexTupleClass<Vs...>, IntSeqClass<Type, Values...> >
|
template<typename Tup> \
|
||||||
: public sprout::identity<UIndexTupleClass<Vs..., Values...> >
|
struct apply \
|
||||||
{};
|
: public sprout::types::detail::joint_types_default_apply<IntegerSequenceClass<Vs...>, Tup> \
|
||||||
template<
|
{}; \
|
||||||
template<sprout::uindex_t...> class UIndexTupleClass, sprout::uindex_t... Vs,
|
}
|
||||||
template<sprout::index_t...> class IndexTupClass, sprout::index_t... Values
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(bool);
|
||||||
>
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(char);
|
||||||
struct joint_types_default_apply<UIndexTupleClass<Vs...>, IndexTupClass<Values...> >
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(signed char);
|
||||||
: public sprout::identity<UIndexTupleClass<Vs..., Values...> >
|
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);
|
||||||
template<
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(char32_t);
|
||||||
template<sprout::uindex_t...> class UIndexTupleClass, sprout::uindex_t... Vs,
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(wchar_t);
|
||||||
template<sprout::uindex_t...> class UIndexTupClass, sprout::uindex_t... Values
|
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);
|
||||||
struct joint_types_default_apply<UIndexTupleClass<Vs...>, UIndexTupClass<Values...> >
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(int);
|
||||||
: public sprout::identity<UIndexTupleClass<Vs..., Values...> >
|
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);
|
||||||
template<template<sprout::uindex_t...> class UIndexTupleClass, sprout::uindex_t... Vs>
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(unsigned long);
|
||||||
struct joint_types_default<UIndexTupleClass<Vs...> > {
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(long long);
|
||||||
public:
|
SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL(unsigned long long);
|
||||||
template<typename Tup>
|
#undef SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL_FOR_CERTAIN_INTEGER_SEQUENCE
|
||||||
struct apply
|
#undef SPROUT_TYPES_DETAIL_JOINT_TYPES_DEFAULT_APPLY_CERTAIN_INTEGER_SEQUENCE_DECL
|
||||||
: public sprout::types::detail::joint_types_default_apply<UIndexTupleClass<Vs...>, Tup>
|
|
||||||
{};
|
|
||||||
};
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -33,22 +33,34 @@ namespace sprout {
|
||||||
: public sprout::identity<IntegerSequenceClass<T, Types::value...> >
|
: public sprout::identity<IntegerSequenceClass<T, Types::value...> >
|
||||||
{};
|
{};
|
||||||
};
|
};
|
||||||
template<template<sprout::index_t...> class IndexTupleClass, sprout::index_t... Vs>
|
|
||||||
struct rebind_types_default<IndexTupleClass<Vs...> > {
|
#define SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(TYPE) \
|
||||||
public:
|
template<template<TYPE...> class IndexTupleClass, TYPE... Vs> \
|
||||||
template<typename... Types>
|
struct rebind_types_default<IndexTupleClass<Vs...> > { \
|
||||||
struct apply
|
public: \
|
||||||
: public sprout::identity<IndexTupleClass<Types::value...> >
|
template<typename... Types> \
|
||||||
{};
|
struct apply \
|
||||||
};
|
: public sprout::identity<IndexTupleClass<Types::value...> > \
|
||||||
template<template<sprout::uindex_t...> class UIndexTupleClass, sprout::uindex_t... Vs>
|
{}; \
|
||||||
struct rebind_types_default<UIndexTupleClass<Vs...> > {
|
}
|
||||||
public:
|
|
||||||
template<typename... Types>
|
SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(bool);
|
||||||
struct apply
|
SPROUT_TYPES_DETAIL_REBIND_TYPES_DEFAULT_INTEGER_SEQUENCE_LIKE_DECL(char);
|
||||||
: public sprout::identity<UIndexTupleClass<Types::value...> >
|
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
|
} // namespace detail
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -42,31 +42,47 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
namespace detail {
|
namespace detail {
|
||||||
template<typename Tuple>
|
template<typename Tuple>
|
||||||
struct tuple_size_impl
|
struct tuple_size_default_impl
|
||||||
: public sprout::detail::nil_base
|
: public sprout::detail::nil_base
|
||||||
{};
|
{};
|
||||||
template<template<typename...> class TupleClass, typename... Ts>
|
template<template<typename...> class TupleClass, typename... Ts>
|
||||||
struct tuple_size_impl<TupleClass<Ts...> >
|
struct tuple_size_default_impl<TupleClass<Ts...> >
|
||||||
: public sprout::integral_constant<std::size_t, sizeof...(Ts)>
|
: public sprout::integral_constant<std::size_t, sizeof...(Ts)>
|
||||||
{};
|
{};
|
||||||
template<template<typename VT, VT...> class IntegerSequenceClass, typename T, T... Vs>
|
template<template<typename VT, VT...> class IntegerSequenceClass, typename T, T... Vs>
|
||||||
struct tuple_size_impl<IntegerSequenceClass<T, Vs...> >
|
struct tuple_size_default_impl<IntegerSequenceClass<T, Vs...> >
|
||||||
: public sprout::integral_constant<std::size_t, sizeof...(Vs)>
|
|
||||||
{};
|
|
||||||
template<template<sprout::index_t...> class IndexTupleClass, sprout::index_t... Vs>
|
|
||||||
struct tuple_size_impl<IndexTupleClass<Vs...> >
|
|
||||||
: public sprout::integral_constant<std::size_t, sizeof...(Vs)>
|
|
||||||
{};
|
|
||||||
template<template<sprout::uindex_t...> class UIndexTupleClass, sprout::uindex_t... Vs>
|
|
||||||
struct tuple_size_impl<UIndexTupleClass<Vs...> >
|
|
||||||
: public sprout::integral_constant<std::size_t, sizeof...(Vs)>
|
: public sprout::integral_constant<std::size_t, sizeof...(Vs)>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
#define SPROUT_TYPES_DETAIL_TUPLE_SIZE_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(TYPE) \
|
||||||
|
template<template<TYPE...> class IntegerSequenceClass, TYPE... Vs> \
|
||||||
|
struct tuple_size_default_impl<IntegerSequenceClass<Vs...> > \
|
||||||
|
: public sprout::integral_constant<std::size_t, sizeof...(Vs)> \
|
||||||
|
{}
|
||||||
|
|
||||||
|
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<typename Tuple, bool = sprout::has_value<sprout::tuples::tuple_size<Tuple> >::value>
|
template<typename Tuple, bool = sprout::has_value<sprout::tuples::tuple_size<Tuple> >::value>
|
||||||
struct tuple_size_default;
|
struct tuple_size_default;
|
||||||
template<typename Tuple>
|
template<typename Tuple>
|
||||||
struct tuple_size_default<Tuple, false>
|
struct tuple_size_default<Tuple, false>
|
||||||
: public sprout::types::detail::tuple_size_impl<Tuple>
|
: public sprout::types::detail::tuple_size_default_impl<Tuple>
|
||||||
{};
|
{};
|
||||||
template<typename Tuple>
|
template<typename Tuple>
|
||||||
struct tuple_size_default<Tuple, true>
|
struct tuple_size_default<Tuple, true>
|
||||||
|
@ -94,14 +110,30 @@ namespace sprout {
|
||||||
struct tuple_element_default_impl<I, IntegerSequenceClass<T, Vs...> >
|
struct tuple_element_default_impl<I, IntegerSequenceClass<T, Vs...> >
|
||||||
: public std::tuple_element<I, sprout::types::type_tuple<sprout::integral_constant<T, Vs>...> >
|
: public std::tuple_element<I, sprout::types::type_tuple<sprout::integral_constant<T, Vs>...> >
|
||||||
{};
|
{};
|
||||||
template<std::size_t I, template<sprout::index_t...> class IndexTupleClass, sprout::index_t... Vs>
|
|
||||||
struct tuple_element_default_impl<I, IndexTupleClass<Vs...> >
|
#define SPROUT_TYPES_DETAIL_TUPLE_ELEMENT_DEFAULT_IMPL_INTEGER_SEQUENCE_LIKE_DECL(TYPE) \
|
||||||
: public std::tuple_element<I, sprout::types::type_tuple<sprout::integral_constant<sprout::index_t, Vs>...> >
|
template<std::size_t I, template<TYPE...> class IntegerSequenceClass, TYPE... Vs> \
|
||||||
{};
|
struct tuple_element_default_impl<I, IntegerSequenceClass<Vs...> > \
|
||||||
template<std::size_t I, template<sprout::uindex_t...> class UIndexTupleClass, sprout::uindex_t... Vs>
|
: public std::tuple_element<I, sprout::types::type_tuple<sprout::integral_constant<TYPE, Vs>...> > \
|
||||||
struct tuple_element_default_impl<I, UIndexTupleClass<Vs...> >
|
{}
|
||||||
: public std::tuple_element<I, sprout::types::type_tuple<sprout::integral_constant<sprout::uindex_t, Vs>...> >
|
|
||||||
{};
|
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<std::size_t I, typename Tuple, bool = sprout::has_type<sprout::tuples::tuple_element<I, Tuple> >::value>
|
template<std::size_t I, typename Tuple, bool = sprout::has_type<sprout::tuples::tuple_element<I, Tuple> >::value>
|
||||||
struct tuple_element_default;
|
struct tuple_element_default;
|
||||||
|
|
Loading…
Reference in a new issue