@@ -1239,6 +1239,38 @@ Note: In \code{cpp}, the default \code{bool} values are \code{true} and
12391239\code {false} whereas in R the valid types are \code {TRUE} or \code {FALSE}.
12401240
12411241
1242+ \subsection {Can I use C++11, C++14, C++17, ... with \pkg {Rcpp}? }
1243+
1244+ But of course. In a nutshell, this boils down to \emph {what your compiler
1245+ supports }, and also \emph {what R supports }. We expanded a little on this in
1246+ \href {http://gallery.rcpp.org/articles/rcpp-and-c++11-c++14-c++17/}{Rcpp Gallery
1247+ article} providing more detail. What follows in an abridged summary.
1248+
1249+ You can always \emph {locally } set appropriate \code {PKG\_ CXXFLAGS} as an
1250+ environment variable, or via \code {~/.R/Makevars}. You can also plugins and/or R
1251+ support from \code {src/Makevars}:
1252+
1253+ \begin {itemize }
1254+
1255+ \item [\emph {C++11 }] has been supported since early 2013 via a plugin selecting
1256+ the language standard which is useful for \code {sourceCpp()} etc. For
1257+ packages, R has supported it since R 3.1.0 which added the option to select
1258+ the language standard via \code {CXX\_ STD = CXX11}. As of early 2017, over 120
1259+ packages on CRAN use this.
1260+
1261+ \item [\emph {C++14 }] has been supported since early 2016 via a plugin selecting
1262+ the language standard which is useful for \code {sourceCpp()} etc. For
1263+ packages, R supports it since R 3.4.0 adding the option to select the language
1264+ standard via \code {CXX\_ STD = CXX14}.
1265+
1266+ \item [\emph {C++17 }] is itself more experimental now, but if you have a compiler
1267+ supporting (at least parts of) it, you can use it via plugin (starting with
1268+ Rcpp 0.12.10) for use via \code {sourceCpp()}, or via \code {PKG\_ CXXFLAGS} or
1269+ other means to set compiler options. R support may be available at a later
1270+ date.
1271+
1272+ \end {itemize }
1273+
12421274
12431275\section {Support }
12441276
0 commit comments