I tried to implement the C++14 alias template make_integer_sequence
, which simplifies the creation of the class template integer_sequence.
templ
Simple implementation O(N). Probably not what you want for large N, but my application is only for calling functions with indexed arguments, and I wouldn't expect an arity of more than about 10. I haven't filled in the members of integer_sequence. I'm looking forward to using a standard library implementation and nuking this :)
template
struct integer_sequence
{ };
template
struct make_integer_sequence_impl
{
template
struct tmp;
template
struct tmp>
{
using type = integer_sequence;
};
using type = typename tmp::type>::type;
};
template
struct make_integer_sequence_impl::type>
{ using type = integer_sequence; };
template
using make_integer_sequence = typename make_integer_sequence_impl::type;