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 @@ -1392,18 +1392,14 @@ inline SEXP r_vector<T>::resize_names(SEXP x, R_xlen_t size) {
1392
1392
1393
1393
} // namespace writable
1394
1394
1395
- // TODO: is there a better condition we could use, e.g. assert something true
1396
- // rather than three things false?
1397
- template <typename C, typename T>
1398
- using is_container_but_not_sexp_or_string = typename std::enable_if<
1395
+ // Ensure that C is not constructible from SEXP, and neither C nor T is a std::string
1396
+ template <typename C, typename T = typename std::decay<C>::type::value_type>
1397
+ typename std::enable_if<
1399
1398
!std::is_constructible<C, SEXP>::value &&
1400
1399
!std::is_same<typename std::decay<C>::type, std::string>::value &&
1401
1400
!std::is_same<typename std::decay<T>::type, std::string>::value,
1402
- typename std::decay<C>::type>::type;
1403
-
1404
- template <typename C, typename T = typename std::decay<C>::type::value_type>
1405
- // typename T = typename C::value_type>
1406
- is_container_but_not_sexp_or_string<C, T> as_cpp (SEXP from) {
1401
+ C>::type
1402
+ as_cpp (SEXP from) {
1407
1403
auto obj = cpp11::r_vector<T>(from);
1408
1404
return {obj.begin (), obj.end ()};
1409
1405
}
You can’t perform that action at this time.
0 commit comments