cpp11 icon indicating copy to clipboard operation
cpp11 copied to clipboard

`BEGIN_CPP11 + END_CPP11` -> using `Rf_errorcall(call, ...)`

Open romainfrancois opened this issue 1 year ago • 1 comments
trafficstars

I believe we could expand on END_CPP11 (or add a sibling).

https://github.com/r-lib/cpp11/blob/51f4cd5ad9425a491dedf951a3679346d416e51c/inst/include/cpp11/declarations.hpp#L47-L63

so that it would take parameters, easily generated in generate_cpp_functions(), i.e. package and funs$name

https://github.com/r-lib/cpp11/blob/51f4cd5ad9425a491dedf951a3679346d416e51c/R/register.R#L165-L185

so that we could construct a call to use in Rf_errorcall() instead of using R_NilValue.

romainfrancois avatar Apr 19 '24 10:04 romainfrancois

I did something similar in duckdb, it has cpp11 vendored.

krlmlr avatar May 01 '24 18:05 krlmlr