| 32 | typedef typename Rcpp::traits::storage_type<RTYPE>::type STORAGE ; |
| 33 | |
| 34 | Tail( const VEC_TYPE& object_, R_xlen_t n_ ) : object(object_), start(0), n(n_) { |
| 35 | if( n > 0 ){ |
| 36 | start = object.size() - n ; |
| 37 | } else { |
| 38 | start = -n ; |
| 39 | n = object.size() - start ; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | inline STORAGE operator[]( R_xlen_t i ) const { |
| 44 | return object[ start + i ] ; |