When registering a function in a namespace such as
[[cpp11::register]] int foo::bar(int a) {
return a;
}
decor recognizes the function name as foo::bar and all would be fine (as far as I can tell), if the generated extern "C" wrapper
|
{return_type} {name}({real_params}); |
|
extern "C" SEXP _{package}_{name}({sexp_params}) {{ |
|
BEGIN_CPP11 |
|
{calls} |
|
END_CPP11 |
|
}} |
would not blindly forward the ::. Some further minor adjustments are required for the generation of the R-side functions. For the R-side function name, we could for example strip away anything that comes before the last scope resolution operator.
I started putting something together under main...nbenn:main and I'm happy to clean this up a bit, add some tests and submit a PR.
When registering a function in a namespace such as
decor recognizes the function name as
foo::barand all would be fine (as far as I can tell), if the generatedextern "C"wrappercpp11/R/register.R
Lines 171 to 176 in c22dc9b
would not blindly forward the
::. Some further minor adjustments are required for the generation of the R-side functions. For the R-side function name, we could for example strip away anything that comes before the last scope resolution operator.I started putting something together under main...nbenn:main and I'm happy to clean this up a bit, add some tests and submit a PR.