[Rcpp-devel] "binding" Rcpp::InternalFunction or Rcpp::CppFunction

Dirk Eddelbuettel edd at debian.org
Fri Aug 1 13:45:20 CEST 2014


Christian,

I don't have time comment in full but two brief comments:

On 1 August 2014 at 13:17, Christian Authmann wrote:
| And we cannot use c++11's std::function in rcpp since CRAN won't allow it
| (or did that change?)

We can use C++11 (since R 3.1.0) and sometimes do, eg I have two small
packages with a Depends: R (>= 3.1.0). 

You have to be careful of the implication as the package won't make it to old
installations still runing R 2.15.* or 3.0, or those with old compilers ---
which is why this practice is not as wide-spread yet.  

But beyond those drawbacks you can use C++11 (and even C++14 if your compiler
supports it) in your Rcpp packages on CRAN now.  See RcppBDT and RcppCNPy for
the mechanics.
 
| e) some other approach you'll advise me of ;)

We have examples of doing something similar (at least if I understand your
issue correctly) via R's external pointers and the Rcpp::XPtr class which 
wraps them.  

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list