Repository navigation
Closed
Description
I see:
> Rcpp:::capabilities()["variadic templates"]
variadic templates
FALSEThis is checked here:
Lines 174 to 178 in dfa585d
| #ifdef HAS_VARIADIC_TEMPLATES | |
| LOGICAL(cap)[0] = TRUE; | |
| #else | |
| LOGICAL(cap)[0] = FALSE; | |
| #endif |
But HAS_VARIADIC_TEMPLATES is never set (note that the defines are commented out):
Rcpp/inst/include/Rcpp/platform/compiler.h
Lines 66 to 97 in dfa585d
| // Check C++0x/11 features | |
| #if defined(__INTEL_COMPILER) | |
| #if __cplusplus >= 201103L | |
| #define RCPP_USING_CXX11 | |
| #if __INTEL_COMPILER >= 1210 | |
| // #define HAS_VARIADIC_TEMPLATES | |
| #endif | |
| #if __INTEL_COMPILER >= 1100 | |
| #define HAS_STATIC_ASSERT | |
| #endif | |
| #endif | |
| #elif defined(__clang__) | |
| #if __cplusplus >= 201103L | |
| #define RCPP_USING_CXX11 | |
| #if __has_feature(cxx_variadic_templates) | |
| // #define HAS_VARIADIC_TEMPLATES | |
| #endif | |
| #if __has_feature(cxx_static_assert) | |
| #define HAS_STATIC_ASSERT | |
| #endif | |
| #endif | |
| #elif defined(__GNUC__) | |
| #ifdef __GXX_EXPERIMENTAL_CXX0X__ | |
| #if GCC_VERSION >= 40300 | |
| // #define HAS_VARIADIC_TEMPLATES | |
| #define HAS_STATIC_ASSERT | |
| #endif | |
| #endif | |
| #if GCC_VERSION >= 40800 && __cplusplus >= 201103L | |
| #define RCPP_USING_CXX11 | |
| #endif | |
| #endif |
Reacted by Dirk Eddelbuettel and Kevin Ushey
Metadata
Metadata
Assignees
Labels
No labels
Activity
Enchufa2 commentedon Sep 5, 2024
I traced this code back to 270c856 that comes from this discussion. Those three lines ended up commented out after this message, that reports some issues with such feature enabled. However:
HAS_VARIADIC_TEMPLATESin the current codebase are in the#if defined(HAS_VARIADIC_TEMPLATES) || defined(RCPP_USING_CXX11)checks added by @andrjohns as part of his PR.So uncommenting these 3 lines has no impact beyond correctly reporting this capability. Do you want me to open a PR? Or should we kindly ask @andrjohns to enable such defines as part of #1328, and then maybe also simplify the above checks by dropping the
|| defined(RCPP_USING_CXX11)part?eddelbuettel commentedon Sep 5, 2024
I like both cleanup aspects. We can surely remove the commented-out and unused bit, and also amplifying the actual usefulness of the usage seems like a good idea. @andrjohns is closest to the metal here. Any thoughts?