The credit for that bit of cleverness should go to Romain. He mentioned the trick here some time ago, http://www.mail-archive.com/[email protected]/msg01807.html
Jelmer On Mon, Jan 23, 2012 at 00:20, Dirk Eddelbuettel <[email protected]> wrote: > > Michael, > > Can you mock up a more complete example of what you are trying to do? > > I am a little worried about the lifecycle of objects allocated that way, > about who owns them, and what happens to the memory. From my casual look at > it, Jelmer's code is pretty clever but I am not sure calling R's new() to > allocate inside of what you consider a C++ object might be too clever by half > and hurt you later. > > Rcpp::XPtr() will always fit in the framework of .Call() functions receiving > and returning SEXP. > > On the other hand, Rcpp modules are very useful, but also known to have > limits as eg the lack of serialization/deserialization for load and save. > > Dirk > > -- > "Outside of a dog, a book is a man's best friend. Inside of a dog, it is too > dark to read." -- Groucho Marx _______________________________________________ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
