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 @@ -1432,18 +1432,14 @@ inline SEXP r_vector<T>::resize_names(SEXP x, R_xlen_t size) {
14321432
14331433} // namespace writable
14341434
1435- // TODO: is there a better condition we could use, e.g. assert something true
1436- // rather than three things false?
1437- template <typename C, typename T>
1438- using is_container_but_not_sexp_or_string = typename std::enable_if<
1435+ // Ensure that C is not constructible from SEXP, and neither C nor T is a std::string
1436+ template <typename C, typename T = typename std::decay<C>::type::value_type>
1437+ typename std::enable_if<
14391438 !std::is_constructible<C, SEXP>::value &&
14401439 !std::is_same<typename std::decay<C>::type, std::string>::value &&
14411440 !std::is_same<typename std::decay<T>::type, std::string>::value,
1442- typename std::decay<C>::type>::type;
1443-
1444- template <typename C, typename T = typename std::decay<C>::type::value_type>
1445- // typename T = typename C::value_type>
1446- is_container_but_not_sexp_or_string<C, T> as_cpp (SEXP from) {
1441+ C>::type
1442+ as_cpp (SEXP from) {
14471443 auto obj = cpp11::r_vector<T>(from);
14481444 return {obj.begin (), obj.end ()};
14491445}
You can’t perform that action at this time.
0 commit comments