In the example below, I have no difficulty exporting some normal c++ method into R using RCPP_MODULE except the method clone that makes the compilation failed.
struct C
{
void clone(C* other)
{
*this = *other;
}
};
#include <Rcpp.h>
using namespace Rcpp;
RCPP_MODULE(mod){
class_<C>("C")
.method("clone", &C::clone)
;
};
How to export the clone method so I can reference to other C++ class that is created in R?
The following works with the development version of Rcpp. See this article on my blog.