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

Method assign_sugar_expression

inst/include/Rcpp/vector/Vector.h:1035–1046  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1033
1034 template <typename T>
1035 inline void assign_sugar_expression( const T& x ) {
1036 R_xlen_t n = size() ;
1037 if( n == x.size() ){
1038 // just copy the data
1039 import_expression<T>(x, n ) ;
1040 } else{
1041 // different size, so we change the memory
1042 Shield<SEXP> wrapped(wrap(x));
1043 Shield<SEXP> casted(r_cast<RTYPE>(wrapped));
1044 Storage::set__(casted);
1045 }
1046 }
1047
1048 // sugar
1049 template <typename T>

Callers

nothing calls this directly

Calls 2

wrapFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected