1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
#ifndef RCPP_TRAITS_INDEX_SEQUENCE_H
#define RCPP_TRAITS_INDEX_SEQUENCE_H
namespace Rcpp {
namespace traits {
/**
* C++11 implementations for index_sequence and make_index_sequence.
* To avoid name conflicts or ambiguity when compiling with C++14 or later,
* they should always be prefaced with `Rcpp::traits::` when used.
*/
template <int...>
struct index_sequence {};
template <int N, int... Is>
struct make_index_sequence : make_index_sequence<N-1, N-1, Is...> {};
template <int... Is>
struct make_index_sequence<0, Is...> : index_sequence<Is...> {};
}
}
#endif
|