Skip to content

Commit 8a44ae1

Browse files
authored
Merge pull request #1228 from RcppCore/feature/c++23
Support C++20 and C++23 (in r-devel)
2 parents b7f44cf + bf40e56 commit 8a44ae1

File tree

5 files changed

+40
-5
lines changed

5 files changed

+40
-5
lines changed

ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2022-09-20 Dirk Eddelbuettel <[email protected]>
2+
3+
* DESCRIPTION (Version, Date): Roll minor version
4+
* inst/include/Rcpp/config.h: Idem
5+
6+
* R/Attributes.R: Support C++20, C++23 and C++2b (for experimental /
7+
incomplete support) via new plugins
8+
19
2022-07-27 Dirk Eddelbuettel <[email protected]>
210

311
* DESCRIPTION (Version, Date): Roll minor version

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: Rcpp
22
Title: Seamless R and C++ Integration
3-
Version: 1.0.9.1
4-
Date: 2022-07-27
3+
Version: 1.0.9.2
4+
Date: 2022-09-20
55
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou,
66
Nathan Russell, Inaki Ucar, Douglas Bates and John Chambers
77
Maintainer: Dirk Eddelbuettel <[email protected]>

R/Attributes.R

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,23 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) {
543543
list(env = list(PKG_CXXFLAGS ="-std=c++17"))
544544
}
545545

546+
# built-in C++20 plugin for C++20
547+
.plugins[["cpp20"]] <- function() {
548+
if (getRversion() >= "4.2") # with recent R versions, R can decide
549+
list(env = list(USE_CXX20 = "yes"))
550+
else
551+
list(env = list(PKG_CXXFLAGS ="-std=c++20"))
552+
}
553+
554+
# built-in C++23 plugin for C++23
555+
.plugins[["cpp23"]] <- function() {
556+
if (getRversion() >= "4.3") # with recent R versions, R can decide
557+
list(env = list(USE_CXX23 = "yes"))
558+
else
559+
list(env = list(PKG_CXXFLAGS ="-std=c++23"))
560+
}
561+
562+
546563
## built-in C++1z plugin for C++17 standard under development
547564
## note that as of Feb 2017 this is taken to be a moving target
548565
## see https://gcc.gnu.org/projects/cxx-status.html
@@ -556,6 +573,11 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) {
556573
list(env = list(PKG_CXXFLAGS ="-std=c++2a"))
557574
}
558575

576+
## built-in C++2b plugin for compilers without C++23 support
577+
.plugins[["cpp2b"]] <- function() {
578+
list(env = list(PKG_CXXFLAGS ="-std=c++2b"))
579+
}
580+
559581
## built-in OpenMP plugin
560582
.plugins[["openmp"]] <- function() {
561583
list(env = list(PKG_CXXFLAGS="-fopenmp",

inst/NEWS.Rd

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
\newcommand{\ghpr}{\href{https://github.com/RcppCore/Rcpp/pull/#1}{##1}}
44
\newcommand{\ghit}{\href{https://github.com/RcppCore/Rcpp/issues/#1}{##1}}
55

6-
\section{Changes in Rcpp release version 1.0.9.1 (2022-07-27)}{
6+
\section{Changes in Rcpp release version 1.0.9.2 (2022-09-20)}{
77
\itemize{
88
\item Changes in Rcpp API:
99
\itemize{
@@ -13,6 +13,11 @@
1313
anymore and has no effect. The associated plugin \code{unwindProtect}
1414
is therefore deprecated and will be removed in a future release.
1515
}
16+
\item Changes in Rcpp Attributes:
17+
\itemize{
18+
\item The C++20, C++2b (experimental) and C++23 standards now have
19+
plugin support like the other C++ standards (Dirk in \ghpr{1228})
20+
}
1621
}
1722
}
1823

inst/include/Rcpp/config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define RCPP_VERSION_STRING "1.0.9"
3131

3232
// the current source snapshot (using four components, if a fifth is used in DESCRIPTION we ignore it)
33-
#define RCPP_DEV_VERSION RcppDevVersion(1,0,9,1)
34-
#define RCPP_DEV_VERSION_STRING "1.0.9.1"
33+
#define RCPP_DEV_VERSION RcppDevVersion(1,0,9,2)
34+
#define RCPP_DEV_VERSION_STRING "1.0.9.2"
3535

3636
#endif

0 commit comments

Comments
 (0)