diff --git a/sprout/index_tuple/class.hpp b/sprout/index_tuple/class.hpp index f2eeaf75..72426866 100644 --- a/sprout/index_tuple/class.hpp +++ b/sprout/index_tuple/class.hpp @@ -2,6 +2,7 @@ #define SPROUT_INDEX_TUPLE_CLASS_HPP #include +#include #include #include #include diff --git a/sprout/index_tuple/index_n.hpp b/sprout/index_tuple/index_n.hpp index 996e637f..37129a6a 100644 --- a/sprout/index_tuple/index_n.hpp +++ b/sprout/index_tuple/index_n.hpp @@ -10,7 +10,15 @@ namespace sprout { // // index_n + // uindex_n // +#if SPROUT_USE_TEMPLATE_ALIASES + template + using index_n = sprout::integer_n; + + template + using uindex_n = sprout::integer_n; +#else // #if SPROUT_USE_TEMPLATE_ALIASES template struct index_n : public sprout::enable_make_indexes< @@ -18,9 +26,7 @@ namespace sprout { ::template transfer > > {}; - // - // uindex_n - // + template struct uindex_n : public sprout::enable_make_indexes< @@ -28,6 +34,7 @@ namespace sprout { ::template transfer > > {}; +#endif // #if SPROUT_USE_TEMPLATE_ALIASES } // namespace sprout #endif // #ifndef SPROUT_INDEX_TUPLE_INDEX_N_HPP diff --git a/sprout/index_tuple/index_pack.hpp b/sprout/index_tuple/index_pack.hpp index 95200870..3caf1a98 100644 --- a/sprout/index_tuple/index_pack.hpp +++ b/sprout/index_tuple/index_pack.hpp @@ -9,7 +9,15 @@ namespace sprout { // // index_pack + // uindex_pack // +#if SPROUT_USE_TEMPLATE_ALIASES + template + using index_pack = sprout::integer_pack; + + template + using uindex_pack = sprout::integer_pack; +#else // #if SPROUT_USE_TEMPLATE_ALIASES template struct index_pack : public sprout::enable_make_indexes< @@ -17,9 +25,7 @@ namespace sprout { ::template transfer > > {}; - // - // uindex_pack - // + template struct uindex_pack : public sprout::enable_make_indexes< @@ -27,6 +33,7 @@ namespace sprout { ::template transfer > > {}; +#endif // #if SPROUT_USE_TEMPLATE_ALIASES } // namespace sprout #endif // #ifndef SPROUT_INDEX_TUPLE_INDEX_PACK_HPP diff --git a/sprout/index_tuple/index_range.hpp b/sprout/index_tuple/index_range.hpp index 2e5650ff..2b9f479b 100644 --- a/sprout/index_tuple/index_range.hpp +++ b/sprout/index_tuple/index_range.hpp @@ -9,7 +9,21 @@ namespace sprout { // // index_range + // uindex_range // +#if SPROUT_USE_TEMPLATE_ALIASES + template< + sprout::index_t First, sprout::index_t Last, + typename std::make_signed::type Step = sprout::detail::integer_range_default_step::value + > + using index_range = sprout::integer_range; + + template< + sprout::uindex_t First, sprout::uindex_t Last, + typename std::make_signed::type Step = sprout::detail::integer_range_default_step::value + > + using uindex_range = sprout::integer_range; +#else // #if SPROUT_USE_TEMPLATE_ALIASES template< sprout::index_t First, sprout::index_t Last, typename std::make_signed::type Step = sprout::detail::integer_range_default_step::value @@ -20,9 +34,7 @@ namespace sprout { ::template transfer > > {}; - // - // uindex_range - // + template< sprout::uindex_t First, sprout::uindex_t Last, typename std::make_signed::type Step = sprout::detail::integer_range_default_step::value @@ -33,6 +45,7 @@ namespace sprout { ::template transfer > > {}; +#endif // #if SPROUT_USE_TEMPLATE_ALIASES } // namespace sprout #endif // #ifndef SPROUT_INDEX_TUPLE_INDEX_RANGE_HPP diff --git a/sprout/index_tuple/index_t.hpp b/sprout/index_tuple/index_t.hpp new file mode 100644 index 00000000..546db641 --- /dev/null +++ b/sprout/index_tuple/index_t.hpp @@ -0,0 +1,16 @@ +#ifndef SPROUT_INDEX_TUPLE_INDEX_T_HPP +#define SPROUT_INDEX_TUPLE_INDEX_T_HPP + +#include +#include + +namespace sprout { + // + // index_t + // uindex_t + // + typedef std::ptrdiff_t index_t; + typedef std::size_t uindex_t; +} // namespace sprout + +#endif // #ifndef SPROUT_INDEX_TUPLE_INDEX_T_HPP diff --git a/sprout/index_tuple/index_tuple.hpp b/sprout/index_tuple/index_tuple.hpp index 2a9a6383..bf958169 100644 --- a/sprout/index_tuple/index_tuple.hpp +++ b/sprout/index_tuple/index_tuple.hpp @@ -1,16 +1,22 @@ #ifndef SPROUT_INDEX_TUPLE_INDEX_TUPLE_HPP #define SPROUT_INDEX_TUPLE_INDEX_TUPLE_HPP -#include #include +#include #include namespace sprout { // - // index_t // index_tuple + // uindex_tuple // - typedef std::ptrdiff_t index_t; +#if SPROUT_USE_TEMPLATE_ALIASES + template + using index_tuple = sprout::integer_sequence; + + template + using uindex_tuple = sprout::integer_sequence; +#else // #if SPROUT_USE_TEMPLATE_ALIASES template struct index_tuple : public sprout::integer_sequence @@ -23,11 +29,6 @@ namespace sprout { {}; }; - // - // uindex_t - // uindex_tuple - // - typedef std::size_t uindex_t; template struct uindex_tuple : public sprout::integer_sequence @@ -39,6 +40,7 @@ namespace sprout { : public uindex_tuple {}; }; +#endif // #if SPROUT_USE_TEMPLATE_ALIASES } // namespace sprout #endif // #ifndef SPROUT_INDEX_TUPLE_INDEX_TUPLE_HPP diff --git a/sprout/index_tuple/make_index_tuple.hpp b/sprout/index_tuple/make_index_tuple.hpp index 3a860cb2..00cafeeb 100644 --- a/sprout/index_tuple/make_index_tuple.hpp +++ b/sprout/index_tuple/make_index_tuple.hpp @@ -1,7 +1,6 @@ #ifndef SPROUT_INDEX_TUPLE_MAKE_INDEX_TUPLE_HPP #define SPROUT_INDEX_TUPLE_MAKE_INDEX_TUPLE_HPP -#include #include #include #include @@ -10,7 +9,15 @@ namespace sprout { // // make_index_tuple + // make_uindex_tuple // +#if SPROUT_USE_TEMPLATE_ALIASES + template + using make_index_tuple = sprout::make_integer_sequence; + + template + using make_uindex_tuple = sprout::make_integer_sequence; +#else // #if SPROUT_USE_TEMPLATE_ALIASES template struct make_index_tuple : public sprout::enable_make_indexes< @@ -18,9 +25,7 @@ namespace sprout { ::template transfer >::type > {}; - // - // make_uindex_tuple - // + template struct make_uindex_tuple : public sprout::enable_make_indexes< @@ -28,6 +33,7 @@ namespace sprout { ::template transfer >::type > {}; +#endif // #if SPROUT_USE_TEMPLATE_ALIASES } // namespace sprout #endif // #ifndef SPROUT_INDEX_TUPLE_MAKE_INDEX_TUPLE_HPP diff --git a/sprout/index_tuple/tuple.hpp b/sprout/index_tuple/tuple.hpp index 0308959a..9cdc603b 100644 --- a/sprout/index_tuple/tuple.hpp +++ b/sprout/index_tuple/tuple.hpp @@ -31,6 +31,7 @@ namespace std { typedef typename sprout::tppack_c_at::type type; }; +#if !SPROUT_USE_TEMPLATE_ALIASES // // tuple_size // @@ -60,6 +61,8 @@ namespace std { struct tuple_element > : public std::tuple_element > {}; +#endif // #if SPROUT_USE_TEMPLATE_ALIASES + #if defined(__clang__) # pragma clang diagnostic pop #endif @@ -77,6 +80,7 @@ namespace sprout { return type(); } +#if !SPROUT_USE_TEMPLATE_ALIASES // // tuple_get // @@ -98,6 +102,7 @@ namespace sprout { typedef typename std::tuple_element >::type type; return type(); } +#endif // #if SPROUT_USE_TEMPLATE_ALIASES } // namespace sprout #endif // #ifndef SPROUT_INDEX_TUPLE_TUPLE_HPP