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

Class no_init_vector

inst/include/Rcpp/vector/no_init.h:30–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28class Matrix;
29
30class no_init_vector {
31public:
32 no_init_vector(R_xlen_t size_): size(size_){}
33
34 inline R_xlen_t get() const {
35 return size;
36 }
37
38 template <int RTYPE, template <class> class StoragePolicy >
39 operator Vector<RTYPE, StoragePolicy>() const {
40 // Explicitly protect temporary vector to avoid false positive
41 // with rchk (#892)
42 Shield<SEXP> x(Rf_allocVector(RTYPE, size));
43 Vector<RTYPE, PreserveStorage> ret(x);
44 return ret;
45 }
46
47private:
48 R_xlen_t size ;
49} ;
50
51class no_init_matrix {
52public:

Callers 1

no_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected