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 scary implicit conversion from sexp to bool #757

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

DavisVaughan
Copy link
Member

cpp11 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<bool>(), which checks the type and length before performing the conversion.

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

Copy link
Member

@jennybc jennybc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jennybc jennybc merged commit 1eb64a7 into tidyverse:main Aug 23, 2024
13 checks passed
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