On Wed, 15 Nov 2023 at 12:45, Michael Meyer via R-package-devel <r-package-devel@r-project.org> wrote: > > Greetings, > Suppose I wanted to develop a package with C++ code that contains virtual > functions which the package user should define.It's assumed that evaluation > is expensive so we do not want to define these in R and then call these > R-functions from C++. > Is this a reasonable idea with a standard solution?Are there packages that do > this? > Thanks in advance for all answers,
Not sure if I understand what you are after, but the small RcppXPtrUtils package may be helpful. It provides two things: a utility to compile and wrap a C++ function provided by the user, and another one to check that the signature is correct. See: https://gallery.rcpp.org/articles/passing-cpp-function-pointers-rcppxptrutils/ -- Iñaki Úcar ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel