Last active
January 24, 2021 07:52
-
-
Save yutannihilation/1ce85a2abdeea4f59ce86fda44dd8ca4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rcpp::cppFunction(' | |
void foo() { | |
// works fine if I change the pattern to one without [] | |
std::regex reg("[0-9]"); | |
} | |
', includes = "#include <regex>") | |
# works | |
Sys.setlocale("LC_ALL", 'English') | |
foo() | |
# freezes | |
Sys.setlocale("LC_ALL", 'Japanese') | |
foo() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cpp11::cpp_source( | |
code = | |
'#include <regex> | |
[[cpp11::register]] | |
void foo() { | |
std::regex reg("[0-9]"); | |
} | |
') | |
# works | |
Sys.setlocale("LC_ALL", 'English') | |
foo() | |
# freezes | |
Sys.setlocale("LC_ALL", 'Japanese') | |
foo() |
Author
yutannihilation
commented
Jan 24, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment