We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aeb1895 commit 2d4bbb5Copy full SHA for 2d4bbb5
cpp11test/DESCRIPTION
@@ -20,4 +20,4 @@ Suggests:
20
xml2
21
LazyData: true
22
Roxygen: list(markdown = TRUE)
23
-RoxygenNote: 7.1.1
+RoxygenNote: 7.3.2
inst/include/cpp11/as.hpp
@@ -184,8 +184,14 @@ template <typename T>
184
enable_if_c_string<T, T> as_cpp(SEXP from) {
185
if (Rf_isString(from)) {
186
if (Rf_xlength(from) == 1) {
187
- // TODO: use vmaxget / vmaxset here?
188
- return {unwind_protect([&] { return Rf_translateCharUTF8(STRING_ELT(from, 0)); })};
+ void* vmax = vmaxget();
+
189
+ const char* result =
190
+ unwind_protect([&] { return Rf_translateCharUTF8(STRING_ELT(from, 0)); });
191
192
+ vmaxset(vmax);
193
194
+ return {result};
195
}
196
197
0 commit comments