diff --git a/cpp11test/DESCRIPTION b/cpp11test/DESCRIPTION index d1d05665..70c5649f 100644 --- a/cpp11test/DESCRIPTION +++ b/cpp11test/DESCRIPTION @@ -20,4 +20,4 @@ Suggests: xml2 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.1 +RoxygenNote: 7.3.2 diff --git a/inst/include/cpp11/r_vector.hpp b/inst/include/cpp11/r_vector.hpp index 576f4fe6..601f5d5b 100644 --- a/inst/include/cpp11/r_vector.hpp +++ b/inst/include/cpp11/r_vector.hpp @@ -1392,18 +1392,14 @@ inline SEXP r_vector::resize_names(SEXP x, R_xlen_t size) { } // namespace writable -// TODO: is there a better condition we could use, e.g. assert something true -// rather than three things false? -template -using is_container_but_not_sexp_or_string = typename std::enable_if< +// Ensure that C is not constructible from SEXP, and neither C nor T is a std::string +template ::type::value_type> +typename std::enable_if< !std::is_constructible::value && !std::is_same::type, std::string>::value && !std::is_same::type, std::string>::value, - typename std::decay::type>::type; - -template ::type::value_type> -// typename T = typename C::value_type> -is_container_but_not_sexp_or_string as_cpp(SEXP from) { + C>::type +as_cpp(SEXP from) { auto obj = cpp11::r_vector(from); return {obj.begin(), obj.end()}; }