Daily bit(e) of C++ | std::integer_sequence, std::index_sequence
Daily bit(e) of C++ #471, The C++14 metaprogramming utility: std::integer_sequence.
The std::integer_sequence is a C++14 metaprogramming utility. As its name suggests, it can represent a compile-time sequence of integers.
The underlying integer type can be specified, and the std::index_sequence alias offers a shortcut for std::size_t.
std::make_integer_sequence and std::make_index_sequence are helpers that produce sequences of integers from 0 to N-1.
The primary use case of std::integer_sequence is for manipulating parameter packs.