MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / remove

Method remove

inst/include/Rcpp/api/meat/DottedPairImpl.h:101–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99
100 template <typename CLASS>
101 void DottedPairImpl<CLASS>::remove( const size_t& index ) {
102 CLASS& ref = static_cast<CLASS&>(*this) ;
103 if( static_cast<R_xlen_t>(index) >= Rf_xlength(ref.get__()) ) {
104 const char* fmt = "Dotted Pair index is out of bounds: "
105 "[index=%i; extent=%i].";
106
107 throw index_out_of_bounds(fmt,
108 static_cast<R_xlen_t>(index),
109 ::Rf_xlength(ref.get__()) ) ;
110 }
111
112 if( index == 0 ){
113 ref.set__( CDR( ref.get__() ) ) ;
114 } else{
115 SEXP x = ref.get__() ;
116 size_t i=1;
117 while( i<index ){ x = CDR(x) ; i++; }
118 SETCDR( x, CDDR(x) ) ;
119 }
120 }
121
122
123

Callers 4

runit_pl_remove_1Function · 0.45
runit_pl_remove_2Function · 0.45
runit_pl_remove_3Function · 0.45
runit_removeFunction · 0.45

Calls 2

get__Method · 0.45
set__Method · 0.45

Tested by

no test coverage detected