| 135 | |
| 136 | template <typename IDX> |
| 137 | void check_indices(IDX* x, R_xlen_t n, R_xlen_t size) { |
| 138 | #ifndef RCPP_NO_BOUNDS_CHECK |
| 139 | for (IDX i=0; i < n; ++i) { |
| 140 | if (x[i] < 0 or x[i] >= size) { |
| 141 | if(std::numeric_limits<IDX>::is_integer && size > std::numeric_limits<IDX>::max()) { |
| 142 | stop("use NumericVector to index an object of length %td", size); |
| 143 | } |
| 144 | stop("index error"); |
| 145 | } |
| 146 | } |
| 147 | #endif |
| 148 | } |
| 149 | |
| 150 | void get_indices( traits::identity< traits::int2type<INTSXP> > t ) { |
| 151 | indices.reserve(rhs_n); |