[Rcpp-devel] using an unloaded package's lazy-load data in Rcpp function

2018-04-13 Thread Wasey, Jack O
Dear all, It seems I can reference lazy-loaded data from an unloaded, unattached package from R, but not using the equivalent Rcpp as described in the quickref document. I checked out: http://dirk.eddelbuettel.com/code/rcpp/html/Environment_8h_source.html and even the scant references to envir

Re: [Rcpp-devel] Creating an R interface to non-copyable C++ class

2018-04-13 Thread JJ Allaire
The XPtr is effectively a shared_ptr with special R friendly behavior. Using XPtr is as simple as just passing a pointer to your dynamically allocated C++ object to the XPtr constructor, see https://stackoverflow.com/questions/45947880/pass-a-c-object-as-a-pointer-an-reuse-in-another-function-in-rc