r-lib / cpp11

cpp11 helps you to interact with R objects using C++ code.
https://cpp11.r-lib.org/
Other
193 stars 46 forks source link

`cpp11::function` does not protect its underlying `SEXP` #294

Open paleolimbot opened 1 year ago

paleolimbot commented 1 year ago

Perhaps this was an intentional design decision; however, the behaviour was surprising to me since the other cpp11::<wrapper around an sexp> do this. Maybe it's too expensive to protect here, or maybe just add a note to the documentation? Happy to PR either of those in or close if this behaviour is intentional!

paleolimbot commented 1 year ago

The PR where I ran into this is here: https://github.com/apache/arrow/pull/14436