We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72f4db1 commit 3d5e62fCopy full SHA for 3d5e62f
inst/include/Rcpp/vector/no_init.h
@@ -35,13 +35,12 @@ class no_init_vector {
35
return size;
36
}
37
38
- template <int RTYPE>
39
- operator Vector<RTYPE, PreserveStorage>() const {
+ template <int RTYPE, template <class> class StoragePolicy >
+ operator Vector<RTYPE, StoragePolicy>() const {
40
// Explicitly protect temporary vector to avoid false positive
41
// with rchk (#892)
42
- SEXP x = PROTECT(Rf_allocVector(RTYPE, size));
+ Shield<SEXP> x(Rf_allocVector(RTYPE, size));
43
Vector<RTYPE, PreserveStorage> ret(x);
44
- UNPROTECT(1);
45
return ret;
46
47
0 commit comments