-
-
Notifications
You must be signed in to change notification settings - Fork 219
Description
As shown in Rcpp function with no argument on StackOverflow, there may need to be some slight changes associated with:
- Code generation headers in RcppExports.cpp and RcppExports.R
- Documentation surrounding
Rcpp.package.skeleton()
andcompileAttributes()
The current headers:
RcppExports.R
# This file was generated by Rcpp::compileAttributes
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
RcppExports.cpp
// This file was generated by Rcpp::compileAttributes
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
The proposed new headers:
RcppExports.R
# Generated by using Rcpp::compileAttributes() - do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
RcppExports.cpp
// Generated by using Rcpp::compileAttributes() - do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
Mimics the descriptor used by roxygen2
:
% Generated by roxygen2: do not edit by hand
Documentation Changes
Rcpp.package.skeleton()
Modify the details section to emphasize autocreation and not to modify by hand
Current:
If the attributes argument is TRUE, then rather than generate the example files as described above, a single rcpp_hello_world.cpp file is created in the src directory and it's attributes are compiled using the compileAttributes function, so files RcppExports.R and RcppExports.cpp are generated as well.
Proposed:
If the attributes argument is TRUE, then rather than generate the example files as described above, a single rcpp_hello_world.cpp file is created in the src directory and it's attributes are compiled using the compileAttributes function. This leads to the files RcppExports.R and RcppExports.cpp being generated. They are automatically regenerated from \emph{scratch} each time compileAttributes is called. Therefore, one should not modify by hand either RcppExports file.
compileAttributes
Current
For C++ functions adorned with the Rcpp::export attribute, the C++ and R source code required to bind to the function from R is generated and added (respectively) to src/RcppExports.cpp or R/RcppExports.R.
Proposed:
For C++ functions adorned with the Rcpp::export attribute, the C++ and R source code required to bind to the function from R is generated and added (respectively) to src/RcppExports.cpp or R/RcppExports.R. Both of these files are automatically generated from \emph{scratch} each time compiledAttributes is run.
Tagging as a part of #506