You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Spring cleaning" of some ancient pre-processor directives #1363
Include file inst/include/Rcpp/platform/compiler.h contains a number of ancient tests ("is gcc newer than 4.5 ?") that we should be able to simplify. One approach may be to open a branch and to chip away carefully, building on last year's variadic templates cleanup. I suspect we can get rid of most if not even all these 'else' branches as current Rcpp versions are very unlikely to encounter a compiler than does not have a minimal C++11 fallback.
For example, RCPP_USING_CXX0X_OR_LATER is defined there, but used only in one file (inst/include/Rcpp/sugar/functions/sapply.h) where it provides a fallback for typedef typename via local pre-C++11 implementation. That else case can likely be removed. By going carefully we may be able to get some simplifications in.
Should we be able to insist on 'C++11 or newer' ? It is a large enough watershed that it could lead to more cleanup. (Still noodling in platform/compiler.h after a few so-far-local-only tests.) Is there conceivably anything at CRAN insisting on C++ older than C++11? Non-CRAN builds can always be "cordially invited" to use an older Rcpp release...
R does not support C++98 anymore (since v4.0.0). If you request it, R throws an error. So everything on CRAN compiles with at least C++11. I think it's safe to remove any older bits.
Yep that is what I thought. I started slowly (as I accidentally removed one line too many at the start) and carefully but now added an actual error if it is not at C++11. Stating that as a baseline will make future incremental commits easier.
First commit coming in a minute. Maybe keep an eye on them and eyeball as I go along.
"Because we can" our CI matrix go further back than R 4.0.0 so that version is actually now our baseline provided C++11 is opted into but of course as needed we can also remove some of the older checks. Will learn more about that as we go along.
This sounds good to me. Maybe to make part of Rcpp 1.1.0, with C++11 now being the minimum supported standard? I'd love to tear out all of that generated code bloat.
Activity
Enchufa2 commentedon Mar 14, 2025
Definitely. +1
eddelbuettel commentedon Mar 14, 2025
Should we be able to insist on 'C++11 or newer' ? It is a large enough watershed that it could lead to more cleanup. (Still noodling in
platform/compiler.hafter a few so-far-local-only tests.) Is there conceivably anything at CRAN insisting on C++ older than C++11? Non-CRAN builds can always be "cordially invited" to use an older Rcpp release...Enchufa2 commentedon Mar 14, 2025
R does not support C++98 anymore (since v4.0.0). If you request it, R throws an error. So everything on CRAN compiles with at least C++11. I think it's safe to remove any older bits.
eddelbuettel commentedon Mar 14, 2025
Yep that is what I thought. I started slowly (as I accidentally removed one line too many at the start) and carefully but now added an actual error if it is not at C++11. Stating that as a baseline will make future incremental commits easier.
First commit coming in a minute. Maybe keep an eye on them and eyeball as I go along.
eddelbuettel commentedon Mar 14, 2025
"Because we can" our CI matrix go further back than R 4.0.0 so that version is actually now our baseline provided C++11 is opted into but of course as needed we can also remove some of the older checks. Will learn more about that as we go along.
eddelbuettel commentedon Mar 14, 2025
🙄 Well that didn't work out. Bails well into the 4.* series.
PS I was too optimistic about
__has_feature()but I can just#definegiven the changed baseline.kevinushey commentedon Mar 14, 2025
This sounds good to me. Maybe to make part of Rcpp 1.1.0, with C++11 now being the minimum supported standard? I'd love to tear out all of that generated code bloat.
eddelbuettel commentedon Mar 14, 2025
That's the plan!
eddelbuettel commentedon Mar 18, 2025
Rev.dep checks panned out fine so #1364 closes this -- and #1365 carries torch forward.