File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -1435,18 +1435,14 @@ inline SEXP r_vector<T>::resize_names(SEXP x, R_xlen_t size) {
14351435
14361436} // namespace writable
14371437
1438- // TODO: is there a better condition we could use, e.g. assert something true
1439- // rather than three things false?
1440- template <typename C, typename T>
1441- using is_container_but_not_sexp_or_string = typename std::enable_if<
1438+ // Ensure that C is not constructible from SEXP, and neither C nor T is a std::string
1439+ template <typename C, typename T = typename std::decay<C>::type::value_type>
1440+ typename std::enable_if<
14421441 !std::is_constructible<C, SEXP>::value &&
14431442 !std::is_same<typename std::decay<C>::type, std::string>::value &&
14441443 !std::is_same<typename std::decay<T>::type, std::string>::value,
1445- typename std::decay<C>::type>::type;
1446-
1447- template <typename C, typename T = typename std::decay<C>::type::value_type>
1448- // typename T = typename C::value_type>
1449- is_container_but_not_sexp_or_string<C, T> as_cpp (SEXP from) {
1444+ C>::type
1445+ as_cpp (SEXP from) {
14501446 auto obj = cpp11::r_vector<T>(from);
14511447 return {obj.begin (), obj.end ()};
14521448}
You can’t perform that action at this time.
0 commit comments