Skip to content

Commit 30edbf5

Browse files
authored
Remove RCPP_USING_CXX11 which is now implicit (#1369)
* Remove RCPP_USING_CXX11 which is now implicit * Roll micro release and date, update NEWS.Rd
1 parent 82c4c5f commit 30edbf5

File tree

10 files changed

+29
-63
lines changed

10 files changed

+29
-63
lines changed

ChangeLog

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2025-03-21 Dirk Eddelbuettel <[email protected]>
2+
3+
* DESCRIPTION (Version, Date): Roll micro version and date
4+
* inst/include/Rcpp/config.h: Idem
5+
6+
* inst/include/Rcpp/String.h: Remove explicit RCPP_USING_CXX11 as
7+
use of C++11 (or newer) is both implicit and ensuredIdem
8+
* inst/include/Rcpp/macros/dispatch.h: Idem
9+
* inst/include/Rcpp/platform/compiler.h: Idem
10+
* inst/include/Rcpp/unwindProtect.h: Idem
11+
* inst/tinytest/cpp/wrap.cpp: Idem
12+
* src/api.cpp: Idem
13+
114
2025-03-18 Dirk Eddelbuettel <[email protected]>
215

316
* DESCRIPTION (Version, Date): Roll micro version and date

DESCRIPTION

+2-2
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.14.8
4-
Date: 2025-03-17
3+
Version: 1.0.14.9
4+
Date: 2025-03-21
55
Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "[email protected]",
66
comment = c(ORCID = "0000-0001-6419-907X")),
77
person("Romain", "Francois", role = "aut",

inst/NEWS.Rd

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
C++11 as the minunum (Dirk in \ghpr{1364} closing \ghit{1363})
2020
\item Variadic templates are now used onconditionally given C++11 (Dirk
2121
in \ghpr{1367} closing \ghit{1366})
22+
\item Remove \code{RCPP_USING_CXX11} as a \code{#define} as C++11 is
23+
now a given (Dirk in \ghpr{1369})
2224
}
2325
\item Changes in Rcpp Documentation:
2426
\itemize{
@@ -30,7 +32,7 @@
3032
\item Changes in Rcpp Deployment:
3133
\itemize{
3234
\item \code{Rcpp.package.skeleton()} creates \sQuote{URL} and
33-
\sQuote{BugReports} if given a GitHub username (Dirk \ghpr{1358})
35+
\sQuote{BugReports} if given a GitHub username (Dirk in \ghpr{1358})
3436
}
3537
}
3638
}

inst/include/Rcpp/String.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// String.h: Rcpp R/C++ interface class library -- single string
33
//
44
// Copyright (C) 2012 - 2020 Dirk Eddelbuettel and Romain Francois
5-
// Copyright (C) 2021 - 2023 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
5+
// Copyright (C) 2021 - 2025 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
66
//
77
// This file is part of Rcpp.
88
//
@@ -117,7 +117,7 @@ namespace Rcpp {
117117
String(const std::string& s, cetype_t enc = CE_UTF8) : data(R_NilValue), token(R_NilValue), buffer(s), valid(false), buffer_ready(true), enc(enc) {
118118
RCPP_STRING_DEBUG("String(const std::string&, cetype_t)");
119119
}
120-
#ifdef RCPP_USING_CXX11
120+
121121
/** move constructor */
122122
String(String&& s) : data(s.data), token(s.token), buffer(std::move(s.buffer)), valid(s.valid), buffer_ready(s.buffer_ready), enc(s.enc) {
123123
// Erase s.
@@ -134,7 +134,7 @@ namespace Rcpp {
134134
String(std::string&& s, cetype_t enc = CE_UTF8) : data(R_NilValue), token(R_NilValue), buffer(s), valid(false), buffer_ready(true), enc(enc) {
135135
RCPP_STRING_DEBUG("String(std::string&&, cetype_t)");
136136
}
137-
#endif
137+
138138
String(const std::wstring& s, cetype_t enc = CE_UTF8) : data(internal::make_charsexp(s)), token(R_NilValue), valid(true), buffer_ready(false), enc(enc) {
139139
token = Rcpp_PreciousPreserve(data);
140140
RCPP_STRING_DEBUG("String(const std::wstring&, cetype_t)");
@@ -267,7 +267,6 @@ namespace Rcpp {
267267
buffer_ready = true;
268268
return *this;
269269
}
270-
#ifdef RCPP_USING_CXX11
271270
inline String& operator=(String&& other) {
272271
data = other.data;
273272
token = other.token;
@@ -290,7 +289,6 @@ namespace Rcpp {
290289
buffer_ready = true;
291290
return *this;
292291
}
293-
#endif
294292
inline String& operator=(const char* s) {
295293
buffer = s;
296294
valid = false;

inst/include/Rcpp/config.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define RCPP_VERSION_STRING "1.0.14"
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,14,8)
34-
#define RCPP_DEV_VERSION_STRING "1.0.14.8"
33+
#define RCPP_DEV_VERSION RcppDevVersion(1,0,14,9)
34+
#define RCPP_DEV_VERSION_STRING "1.0.14.9"
3535

3636
#endif

inst/include/Rcpp/macros/dispatch.h

+3-33
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// dispatch.h: Rcpp R/C++ interface class library -- macros for dispatch
44
//
55
// Copyright (C) 2012 - 2016 Dirk Eddelbuettel and Romain Francois
6-
// Copyright (C) 2016 Dirk Eddelbuettel, Romain Francois, Artem Klevtsov and Nathan Russell
6+
// Copyright (C) 2016 - 2025 Dirk Eddelbuettel, Romain Francois, Artem Klevtsov and Nathan Russell
77
//
88
// This file is part of Rcpp.
99
//
@@ -23,15 +23,13 @@
2323
#ifndef Rcpp__macros__dispatch_h
2424
#define Rcpp__macros__dispatch_h
2525

26-
// The variadic macros below incorporate techniques presented by
26+
// The variadic macros below incorporate techniques presented by
2727
// Stack Overflow user Richard Hansen in this answer
2828
//
29-
// http://stackoverflow.com/a/11172679/1869097
29+
// http://stackoverflow.com/a/11172679/1869097
3030
//
3131
// and are necessary to avoid the use of GNU compiler extensions.
3232

33-
#ifdef RCPP_USING_CXX11
34-
3533
#define ___RCPP_HANDLE_CASE___(___RTYPE___, ___FUN___, ___RCPPTYPE___, ...) \
3634
case ___RTYPE___: \
3735
return ___FUN___(::Rcpp::___RCPPTYPE___<___RTYPE___>(RCPP_MACRO_FIRST(__VA_ARGS__)) \
@@ -77,32 +75,4 @@
7775
#define RCPP_MACRO_SELECT_25TH(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, \
7876
a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, ...) a25
7977

80-
#else
81-
82-
#define ___RCPP_HANDLE_CASE___(___RTYPE___, ___FUN___, ___OBJECT___, \
83-
___RCPPTYPE___) \
84-
case ___RTYPE___: \
85-
return ___FUN___(::Rcpp::___RCPPTYPE___<___RTYPE___>(___OBJECT___));
86-
87-
#define ___RCPP_RETURN___(__FUN__, __SEXP__, __RCPPTYPE__) \
88-
SEXP __TMP__ = __SEXP__; \
89-
switch (TYPEOF(__TMP__)) { \
90-
___RCPP_HANDLE_CASE___(INTSXP, __FUN__, __TMP__, __RCPPTYPE__) \
91-
___RCPP_HANDLE_CASE___(REALSXP, __FUN__, __TMP__, __RCPPTYPE__) \
92-
___RCPP_HANDLE_CASE___(RAWSXP, __FUN__, __TMP__, __RCPPTYPE__) \
93-
___RCPP_HANDLE_CASE___(LGLSXP, __FUN__, __TMP__, __RCPPTYPE__) \
94-
___RCPP_HANDLE_CASE___(CPLXSXP, __FUN__, __TMP__, __RCPPTYPE__) \
95-
___RCPP_HANDLE_CASE___(STRSXP, __FUN__, __TMP__, __RCPPTYPE__) \
96-
___RCPP_HANDLE_CASE___(VECSXP, __FUN__, __TMP__, __RCPPTYPE__) \
97-
___RCPP_HANDLE_CASE___(EXPRSXP, __FUN__, __TMP__, __RCPPTYPE__) \
98-
default: \
99-
throw std::range_error("Not a vector"); \
100-
}
101-
102-
#define RCPP_RETURN_VECTOR(_FUN_, _SEXP_) \
103-
___RCPP_RETURN___(_FUN_, _SEXP_, Vector)
104-
#define RCPP_RETURN_MATRIX(_FUN_, _SEXP_) \
105-
___RCPP_RETURN___(_FUN_, _SEXP_, Matrix)
106-
#endif
107-
10878
#endif

inst/include/Rcpp/platform/compiler.h

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434
// C++11 features -- that used to be carefully tested for or worked around via CXX0X / TR1
3535
// These defines are all planned to get removed just how a number have already been removed. One at a time...
36-
#define RCPP_USING_CXX11
3736
#include <cmath>
3837
#include <initializer_list>
3938
#include <unordered_map>

inst/include/Rcpp/unwindProtect.h

+1-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// unwind.h: Rcpp R/C++ interface class library -- Unwind Protect
33
//
44
// Copyright (C) 2018 - 2020 RStudio
5-
// Copyright (C) 2021 RStudio, Dirk Eddelbuettel and Iñaki Ucar
5+
// Copyright (C) 2021 - 2025 RStudio, Dirk Eddelbuettel and Iñaki Ucar
66
//
77
// This file is part of Rcpp.
88
//
@@ -23,11 +23,7 @@
2323
#define RCPP_UNWINDPROTECT_H
2424

2525
#include <csetjmp>
26-
27-
#ifdef RCPP_USING_CXX11
2826
#include <functional>
29-
#endif
30-
3127

3228
namespace Rcpp { namespace internal {
3329

@@ -45,12 +41,10 @@ inline void maybeJump(void* unwind_data, Rboolean jump) {
4541
}
4642
}
4743

48-
#ifdef RCPP_USING_CXX11
4944
inline SEXP unwindProtectUnwrap(void* data) {
5045
std::function<SEXP(void)>* callback = (std::function<SEXP(void)>*) data;
5146
return (*callback)();
5247
}
53-
#endif
5448

5549
}} // namespace Rcpp::internal
5650

@@ -76,11 +70,9 @@ inline SEXP unwindProtect(SEXP (*callback)(void* data), void* data) {
7670
token);
7771
}
7872

79-
#ifdef RCPP_USING_CXX11
8073
inline SEXP unwindProtect(std::function<SEXP(void)> callback) {
8174
return unwindProtect(&internal::unwindProtectUnwrap, &callback);
8275
}
83-
#endif
8476

8577
} // namespace Rcpp
8678

inst/tinytest/cpp/wrap.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// wrap.cpp: Rcpp R/C++ interface class library -- wrap unit tests
44
//
5-
// Copyright (C) 2013 Dirk Eddelbuettel and Romain Francois
5+
// Copyright (C) 2013 - 2025 Dirk Eddelbuettel and Romain Francois
66
//
77
// This file is part of Rcpp.
88
//
@@ -168,10 +168,6 @@ SEXP nonnull_const_char(){
168168
return wrap(p) ;
169169
}
170170

171-
#ifdef RCPP_USING_CXX11
172-
// [[Rcpp::plugins(cpp11)]]
173-
#endif
174-
175171
// [[Rcpp::export]]
176172
IntegerVector unordered_map_string_int(){
177173
RCPP_UNORDERED_MAP< std::string, int > m ;

src/api.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,7 @@ SEXP rcpp_can_use_cxx0x() { // #nocov start
229229

230230
// [[Rcpp::internal]]
231231
SEXP rcpp_can_use_cxx11() {
232-
#if defined(RCPP_USING_CXX11)
233-
return Rf_ScalarLogical(TRUE);
234-
#else
235-
return Rf_ScalarLogical(FALSE);
236-
#endif
232+
return Rf_ScalarLogical(TRUE);
237233
}
238234

239235
// [[Rcpp::register]]

0 commit comments

Comments
 (0)