mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-06 14:24:09 +00:00
fix index_tuple implementation: template aliases (if compiler supported)
This commit is contained in:
parent
bb36ef6e8b
commit
3ff1ffb4d9
8 changed files with 78 additions and 21 deletions
|
@ -1,7 +1,6 @@
|
|||
#ifndef SPROUT_INDEX_TUPLE_MAKE_INDEX_TUPLE_HPP
|
||||
#define SPROUT_INDEX_TUPLE_MAKE_INDEX_TUPLE_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/index_tuple/index_tuple.hpp>
|
||||
#include <sprout/index_tuple/make_integer_sequence.hpp>
|
||||
|
@ -10,7 +9,15 @@
|
|||
namespace sprout {
|
||||
//
|
||||
// make_index_tuple
|
||||
// make_uindex_tuple
|
||||
//
|
||||
#if SPROUT_USE_TEMPLATE_ALIASES
|
||||
template<sprout::index_t N>
|
||||
using make_index_tuple = sprout::make_integer_sequence<sprout::index_t, N>;
|
||||
|
||||
template<sprout::uindex_t N>
|
||||
using make_uindex_tuple = sprout::make_integer_sequence<sprout::uindex_t, N>;
|
||||
#else // #if SPROUT_USE_TEMPLATE_ALIASES
|
||||
template<sprout::index_t N>
|
||||
struct make_index_tuple
|
||||
: public sprout::enable_make_indexes<
|
||||
|
@ -18,9 +25,7 @@ namespace sprout {
|
|||
::template transfer<sprout::index_tuple<> >::type
|
||||
>
|
||||
{};
|
||||
//
|
||||
// make_uindex_tuple
|
||||
//
|
||||
|
||||
template<sprout::uindex_t N>
|
||||
struct make_uindex_tuple
|
||||
: public sprout::enable_make_indexes<
|
||||
|
@ -28,6 +33,7 @@ namespace sprout {
|
|||
::template transfer<sprout::uindex_tuple<> >::type
|
||||
>
|
||||
{};
|
||||
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_INDEX_TUPLE_MAKE_INDEX_TUPLE_HPP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue