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

Function checkVersion

inst/tinytest/cpp/rcppversion.cpp:4–22  ·  view source on GitHub ↗

[[Rcpp::export]]

Source from the content-addressed store, hash-verified

2
3// [[Rcpp::export]]
4Rcpp::List checkVersion(Rcpp::IntegerVector v) {
5
6 // incoming, we expect v to have been made by
7 // as.integer(unlist(strsplit(as.character(packageVersion("Rcpp")), "\\.")))
8 // yielding eg
9 // c(1L, 0L, 3L, 1L)
10
11 // ensure that length is four, after possibly appending 0
12 if (v.size() == 3) v.push_back(0);
13 if (v.size() == 4) v.push_back(0);
14 if (v.size() > 5) Rcpp::stop("Expect vector with up to five elements.");
15
16 return Rcpp::List::create(Rcpp::Named("def_ver") = RCPP_VERSION,
17 Rcpp::Named("def_str") = RCPP_VERSION_STRING,
18 Rcpp::Named("cur_ver") = Rcpp_Version(v[0], v[1], v[2]),
19 Rcpp::Named("def_dev_ver") = RCPP_DEV_VERSION,
20 Rcpp::Named("def_dev_str") = RCPP_DEV_VERSION_STRING,
21 Rcpp::Named("cur_dev_ver") = RcppDevVersion(v[0], v[1], v[2], v[3]));
22}

Callers

nothing calls this directly

Calls 4

stopFunction · 0.85
NamedFunction · 0.85
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected