mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
support for N3658 (Compile-time integer sequences): index_tuple
rename: integer_seq -> integer_sequence, make_integer_sequence -> make_integer_sequence add unsigned-index sequence: index_sequence(alias), make_index_sequence, index_sequence_for add: integer_pack, index_pack
This commit is contained in:
parent
a3aedcf136
commit
bb36ef6e8b
24 changed files with 196 additions and 83 deletions
|
@ -4,7 +4,7 @@
|
|||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/index_tuple/integer_seq.hpp>
|
||||
#include <sprout/index_tuple/integer_sequence.hpp>
|
||||
#include <sprout/index_tuple/enable_make_indexes.hpp>
|
||||
|
||||
namespace sprout {
|
||||
|
@ -15,15 +15,15 @@ namespace sprout {
|
|||
template<typename T, typename Seq>
|
||||
struct integer_n_next_even;
|
||||
template<typename T, T... Is>
|
||||
struct integer_n_next_even<T, sprout::integer_seq<T, Is...> >
|
||||
: public sprout::integer_seq<T, Is..., Is...>
|
||||
struct integer_n_next_even<T, sprout::integer_sequence<T, Is...> >
|
||||
: public sprout::integer_sequence<T, Is..., Is...>
|
||||
{};
|
||||
|
||||
template<typename T, typename Seq, T Tail>
|
||||
struct integer_n_next_even_odd;
|
||||
template<typename T, T... Is, T Tail>
|
||||
struct integer_n_next_even_odd<T, sprout::integer_seq<T, Is...>, Tail>
|
||||
: public sprout::integer_seq<T, Is..., Is..., Tail>
|
||||
struct integer_n_next_even_odd<T, sprout::integer_sequence<T, Is...>, Tail>
|
||||
: public sprout::integer_sequence<T, Is..., Is..., Tail>
|
||||
{};
|
||||
|
||||
template<typename T, T I, std::size_t N, typename Enable = void>
|
||||
|
@ -33,14 +33,14 @@ namespace sprout {
|
|||
T, I, N,
|
||||
typename std::enable_if<(N == 0)>::type
|
||||
>
|
||||
: public sprout::integer_seq<T>
|
||||
: public sprout::integer_sequence<T>
|
||||
{};
|
||||
template<typename T, T I, std::size_t N>
|
||||
struct integer_n_impl<
|
||||
T, I, N,
|
||||
typename std::enable_if<(N == 1)>::type
|
||||
>
|
||||
: public sprout::integer_seq<T, I>
|
||||
: public sprout::integer_sequence<T, I>
|
||||
{};
|
||||
template<typename T, T I, std::size_t N>
|
||||
struct integer_n_impl<
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue