#pragma once #include #include "dxxsconf.h" #ifdef DXX_HAVE_CXX14_INTEGER_SEQUENCE #include using std::index_sequence; #else template struct index_sequence {}; #endif template struct cat_index_sequence; template struct cat_index_sequence<0, index_sequence, A2, index_sequence> { typedef index_sequence type; }; /* Fan out to reduce template depth */ template struct tree_index_sequence { typedef typename cat_index_sequence<0, typename tree_index_sequence::type, N / 2, typename tree_index_sequence<(N + 1) / 2>::type>::type type; }; template <> struct tree_index_sequence<0> { typedef index_sequence<> type; }; template <> struct tree_index_sequence<1> { typedef index_sequence<0> type; }; template using make_tree_index_sequence = typename tree_index_sequence::type;