File: index_sequence.h

package info (click to toggle)
rcpp 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,480 kB
  • sloc: cpp: 27,436; ansic: 7,778; sh: 53; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 594 bytes parent folder | download
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