#pragma once #include #include "dxxsconf.h" #if defined(DXX_HAVE_CXX14_TREE_INTEGER_SEQUENCE) || defined(DXX_HAVE_CXX14_INTEGER_SEQUENCE) #include using std::index_sequence; #else template struct index_sequence {}; #endif #if defined(DXX_HAVE_CXX14_TREE_INTEGER_SEQUENCE) template using make_tree_index_sequence = std::make_index_sequence; #else template struct cat_index_sequence; template struct cat_index_sequence, A2, index_sequence> { typedef index_sequence type; }; /* Fan out to reduce template depth */ template struct tree_index_sequence : cat_index_sequence::type, N / 2, typename tree_index_sequence<(N + 1) / 2>::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; #endif