There was an error while loading. Please reload this page.
1 parent e8f723e commit 05ebafaCopy full SHA for 05ebafa
1 file changed
inst/include/Rcpp/vector/ListOf.h
@@ -40,10 +40,9 @@ class ListOf
40
std::transform(list.begin(), list.end(), list.begin(), as<T>);
41
}
42
43
- template <typename U>
44
- ListOf(const U& data_): list(data_) {
45
- std::transform(list.begin(), list.end(), list.begin(), as<T>);
46
- }
+ template <typename U,
+ typename std::enable_if<std::is_convertible<U, SEXP>::value, int>::type = 0>
+ ListOf(const U& data_): ListOf(static_cast<SEXP>(data_)) {}
47
48
ListOf(const ListOf& other): list(other.list) {}
49
0 commit comments