| 78 | template <typename CLASS> |
| 79 | template <typename T> |
| 80 | void DottedPairImpl<CLASS>::replace( const int& index, const T& object ) { |
| 81 | CLASS& ref = static_cast<CLASS&>(*this) ; |
| 82 | if( static_cast<R_xlen_t>(index) >= ::Rf_xlength(ref.get__()) ) { |
| 83 | const char* fmt = "Dotted Pair index is out of bounds: " |
| 84 | "[index=%i; extent=%i]."; |
| 85 | |
| 86 | throw index_out_of_bounds(fmt, |
| 87 | static_cast<R_xlen_t>(index), |
| 88 | ::Rf_xlength(ref.get__()) ) ; |
| 89 | } |
| 90 | |
| 91 | Shield<SEXP> x( pairlist( object ) ); |
| 92 | SEXP y = ref.get__() ; |
| 93 | int i=0; |
| 94 | while( i<index ){ y = CDR(y) ; i++; } |
| 95 | |
| 96 | SETCAR( y, CAR(x) ); |
| 97 | SET_TAG( y, TAG(x) ); |
| 98 | } |
| 99 | |
| 100 | template <typename CLASS> |
| 101 | void DottedPairImpl<CLASS>::remove( const size_t& index ) { |
no test coverage detected