#ifndef EINA_CXX_EINA_INTEGER_SEQUENCE_HH #define EINA_CXX_EINA_INTEGER_SEQUENCE_HH #include /** * @addtogroup Eina_Cxx_Data_Types_Group * * @{ */ namespace efl { namespace eina { /** * @defgroup Eina_Cxx_Integer_Sequence_Group Integer Sequence * @ingroup Eina_Cxx_Data_Types_Group * * @{ */ /** * Compile-time sequence of integers. */ template struct integer_sequence { typedef T value_type; /**< Type of the integers. */ /** * @brief Get the number of elements in the sequence. * @return std::size_t representing the sequence size. */ static constexpr std::size_t size() { return sizeof...(Ints); } typedef integer_sequence type; /**< Type for the sequence instantiation. */ }; template struct concat; /** * Compile-time concatenation of two integer sequences. */ template struct concat, integer_sequence > : integer_sequence {}; template using Concat = typename concat::type; template struct gen_seq; /** * Make a compile time sequence of integers from @c 0 to N-1. */ template using make_integer_sequence = typename gen_seq::type; template struct gen_seq : Concat , make_integer_sequence>{}; template<> struct gen_seq : integer_sequence{}; template<> struct gen_seq : integer_sequence{}; /** * Compile time sequence of indexes. */ template using index_sequence = integer_sequence; /** * Make a compile time sequence of indexes from @c 0 to N-1. */ template using make_index_sequence = make_integer_sequence; template struct pop_integer_sequence_t; template struct pop_integer_sequence_t, integer_sequence > { typedef integer_sequence type; }; template struct pop_integer_sequence_t, integer_sequence > { typedef integer_sequence type; }; template struct pop_integer_sequence_t, integer_sequence > { typedef integer_sequence type; }; template struct pop_integer_sequence_t, integer_sequence > : pop_integer_sequence_t, integer_sequence > { }; template using pop_integer_sequence = typename pop_integer_sequence_t::type; /** * @} */ } } /** * @} */ #endif