mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
add index_tuple/integer_seq
This commit is contained in:
parent
6a78f64feb
commit
331aaa3559
14 changed files with 358 additions and 180 deletions
32
sprout/index_tuple/integer_seq.hpp
Normal file
32
sprout/index_tuple/integer_seq.hpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
#ifndef SPROUT_INDEX_TUPLE_INTEGER_SEQ_HPP
|
||||
#define SPROUT_INDEX_TUPLE_INTEGER_SEQ_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// integer_seq
|
||||
//
|
||||
template<typename T, T... Is>
|
||||
struct integer_seq {
|
||||
public:
|
||||
typedef integer_seq type;
|
||||
template<T... J>
|
||||
struct rebind
|
||||
: public integer_seq<T, J...>
|
||||
{};
|
||||
public:
|
||||
typedef T value_type;
|
||||
template<typename Seq>
|
||||
struct transfer
|
||||
: public Seq::template rebind<Is...>
|
||||
{};
|
||||
public:
|
||||
SPROUT_STATIC_CONSTEXPR std::size_t size = sizeof...(Is);
|
||||
};
|
||||
template<typename T, T... Is>
|
||||
SPROUT_CONSTEXPR_OR_CONST std::size_t sprout::integer_seq<T, Is...>::size;
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_INDEX_TUPLE_INTEGER_SEQ_HPP
|
Loading…
Add table
Add a link
Reference in a new issue