Rcpp11
is an R package and a C++11
library that dramatically facilitates integration of
R
and C++11
.
Rcpp11
will enforce C++11
at the configure
stage.
Therefore it will not be published to CRAN until this distribution
repository decides to finally allow C++11
.
Rcpp11
will only be available on github
during the initial cleaning stage involving:
- removing code from
Rcpp
that should not be there but that is kept inRcpp
because of too strong requirements, because it once was there, because someone somewhere might use it... For example theRCPP_FUNCTION_..
macros that are planned to be removed in july 2014 () inRcpp
. These macros will not be inRcpp11
. - the
Date
etc ... classes inRcpp
are using a design that is different from all other classes of Rcpp, the proxy design. These classes will not be inRcpp11
. Replacements might be included at a later stage if it is needed. Replacements should follow the design principles of classes of theRcpp
API, e.g.RObject
, ... - more emphasis on
C++11
features: e.g. initialisation lists and variadic templates will be used. Rcpp11
will be able to assume features ofC++11
, for example move semantics, and therefore make active use of them: packages depending onRcpp11
won't have to condition compileC++11
availability.Rcpp11
will try to use classes provided byC++11
standard library, e.g. classes for regular expressions.
Because Rcpp11
cannot be on CRAN
because CRAN
insists on the C++98
standard.
I will have to find an alternative distribution repository.
My goal is to setup this repository so that third party packages
depending on Rcpp11
can be published.
To install Rcpp11
from github, you first need to get a compiler that supports C++11
. This is trivial on
recent version of OSX. You can just use clang. I have this on my ~/.R/Makevars
file:
CC=clang
CXX=clang++
PKG_CXXFLAGS= -stdlib=libc++ -std=c++11
Then, you can install it using devtools::install_github
:
devtools::install_github( "romainfrancois/Rcpp11" )
require( Rcpp11 )
evalCpp( "2LL" )
# [1] 2