Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid implicit conversion from sexp to double #39

Merged
merged 1 commit into from
Aug 24, 2024

Conversation

DavisVaughan
Copy link
Contributor

cpp11 currently allows some somewhat scary implicit conversions between sexp and the 3 types bool, size_t, and double. These are unchecked conversions, and we'd like to remove them:
r-lib/cpp11#390

The recommended way is to use cpp11::as_cpp<double>(), which checks the type and length before performing the conversion, and is also explicit, which is a good thing for this kind of conversion.

I'm not going to remove these in the upcoming version of cpp11, but we will in the next after that

@Nowosad
Copy link
Owner

Nowosad commented Aug 24, 2024

Thank you @DavisVaughan

@Nowosad Nowosad merged commit 3f6587b into Nowosad:master Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants