GeezerVison is showing github.com — Use variadic templates unconditionally (#1367) · RcppCore/Rcpp@926b8b8
File treeExpand file treeCollapse file tree Open diff view settings Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: ChangeLog +46Lines changed: 46 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | + | | 2 | + | | 3 | + * DESCRIPTION (Version, Date): Roll micro version and date | | 4 | + * inst/include/Rcpp/config.h: Idem | | 5 | + | | 6 | + * inst/include/Rcpp/module/class.h: Use variadic templates unconditionally | | 7 | + * inst/include/Rcpp/grow.h: Idem | | 8 | + * inst/include/Rcpp/DottedPair.h: Idem | | 9 | + * inst/include/Rcpp/Vector.h: Idem | | 10 | + * inst/include/Rcpp/Function.h: Idem | | 11 | + * inst/include/Rcpp/internal/call.h: Idem | | 12 | + * inst/include/Rcpp/InternalFunctionWithStdFunction.h: Idem | | 13 | + * inst/include/Rcpp/Module.h: Idem | | 14 | + * inst/include/Rcpp/traits/index_sequence.h: Idem | | 15 | + * inst/include/Rcpp/traits/named_object.h: Idem | | 16 | + * inst/include/Rcpp/Language.h: Idem | | 17 | + * inst/include/Rcpp/DataFrame.h: Idem | | 18 | + * inst/include/Rcpp/PairList.h: Idem | | 19 | + * inst/include/Rcpp/InternalFunction.h: Idem | | 20 | + | | 21 | + * inst/include/Rcpp/module/Module_generated_class_constructor.h: Removed | | 22 | + * inst/include/Rcpp/module/Module_generated_class_factory.h: Idem | | 23 | + * inst/include/Rcpp/module/Module_generated_method.h: Idem | | 24 | + * inst/include/Rcpp/module/Module_generated_Pointer_method.h: Idem | | 25 | + * inst/include/Rcpp/generated/grow__pairlist.h: Idem | | 26 | + * inst/include/Rcpp/generated/DottedPair__ctors.h: Idem | | 27 | + * inst/include/Rcpp/generated/Vector__create.h: Idem | | 28 | + * inst/include/Rcpp/generated/Function__operator.h: Idem | | 29 | + * inst/include/Rcpp/generated/InternalFunctionWithStdFunction_call.h: Idem | | 30 | + * inst/include/Rcpp/module/Module_generated_Constructor.h: Idem | | 31 | + * inst/include/Rcpp/module/Module_generated_CppFunction.h: Idem | | 32 | + * inst/include/Rcpp/module/Module_generated_CppMethod.h: Idem | | 33 | + * inst/include/Rcpp/module/Module_generated_Factory.h: Idem | | 34 | + * inst/include/Rcpp/module/Module_generated_Pointer_CppMethod.h: Idem | | 35 | + * inst/include/Rcpp/module/Module_generated_class_signature.h: Idem | | 36 | + * inst/include/Rcpp/module/Module_generated_ctor_signature.h: Idem | | 37 | + * inst/include/Rcpp/module/Module_generated_function.h: Idem | | 38 | + * inst/include/Rcpp/module/Module_generated_get_signature.h: Idem | | 39 | + * inst/include/Rcpp/generated/Language__ctors.h: Idem | | 40 | + * inst/include/Rcpp/generated/DataFrame_generated.h: Idem | | 41 | + * inst/include/Rcpp/generated/Pairlist__ctors.h: Idem | | 42 | + * inst/include/Rcpp/generated/InternalFunction__ctors.h: Idem | | 43 | + | | 44 | + * inst/include/Rcpp/platform/compiler.h: No longer define HAS_VARIADIC_TEMPLATES | | 45 | + * src/api.cpp (rcpp_can_use_cxx0x): Return true unconditionally | | 46 | + | 1 | 47 | | 2 | 48 |
| 3 | 49 | * DESCRIPTION (Version, Date): Roll micro version and date | |
Collapse file Copy file name to clipboardExpand all lines: DESCRIPTION +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | Package: Rcpp | 2 | 2 | Title: Seamless R and C++ Integration | 3 | | -Version: 1.0.14.7 | 4 | | -Date: 2025-03-15 | | 3 | +Version: 1.0.14.8 | | 4 | +Date: 2025-03-17 | 5 | 5 | Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = " [email protected]", | 6 | 6 | comment = c(ORCID = "0000-0001-6419-907X")), | 7 | 7 | person("Romain", "Francois", role = "aut", | |
Collapse file Copy file name to clipboardExpand all lines: inst/include/Rcpp/DataFrame.h +5-9Lines changed: 5 additions & 9 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 | // | 3 | 3 | // DataFrame.h: Rcpp R/C++ interface class library -- data frames | 4 | 4 | // | 5 | | -// Copyright (C) 2010 - 2021 Dirk Eddelbuettel and Romain Francois | | 5 | +// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois | 6 | 6 | // | 7 | 7 | // This file is part of Rcpp. | 8 | 8 | // | @@ -117,14 +117,10 @@ namespace Rcpp{ | 117 | 117 | static DataFrame_Impl create(){ | 118 | 118 | return DataFrame_Impl() ; | 119 | 119 | } | 120 | | - #if defined(HAS_VARIADIC_TEMPLATES) | 121 | | - template <typename... T> | 122 | | - static DataFrame_Impl create(const T&... args) { | 123 | | - return DataFrame_Impl::from_list(Parent::create(args...)); | 124 | | - } | 125 | | - #else | 126 | | - #include <Rcpp/generated/DataFrame_generated.h> | 127 | | - #endif | | 120 | + template <typename... T> | | 121 | + static DataFrame_Impl create(const T&... args) { | | 122 | + return DataFrame_Impl::from_list(Parent::create(args...)); | | 123 | + } | 128 | 124 |
| 129 | 125 | private: | 130 | 126 | void set__(SEXP x){ | |
Collapse file Copy file name to clipboardExpand all lines: inst/include/Rcpp/DottedPair.h +5-9Lines changed: 5 additions & 9 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 | // | 3 | 3 | // DottedPair.h: Rcpp R/C++ interface class library -- dotted pair list template | 4 | 4 | // | 5 | | -// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois | | 5 | +// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois | 6 | 6 | // | 7 | 7 | // This file is part of Rcpp. | 8 | 8 | // | @@ -35,14 +35,10 @@ RCPP_API_CLASS(DottedPair_Impl), | 35 | 35 | DottedPair_Impl(SEXP x) { | 36 | 36 | Storage::set__(x) ; | 37 | 37 | } | 38 | | - #if defined(HAS_VARIADIC_TEMPLATES) | 39 | | - template <typename... T> | 40 | | - DottedPair_Impl(const T&... args) { | 41 | | - Storage::set__(pairlist(args...)); | 42 | | - } | 43 | | - #else | 44 | | - #include <Rcpp/generated/DottedPair__ctors.h> | 45 | | - #endif | | 38 | + template <typename... T> | | 39 | + DottedPair_Impl(const T&... args) { | | 40 | + Storage::set__(pairlist(args...)); | | 41 | + } | 46 | 42 |
| 47 | 43 | void update(SEXP){} | 48 | 44 |
| |
Collapse file Copy file name to clipboardExpand all lines: inst/include/Rcpp/Function.h +3-7Lines changed: 3 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -82,14 +82,10 @@ namespace Rcpp{ | 82 | 82 | return Rcpp_fast_eval(call, R_GlobalEnv); | 83 | 83 | } | 84 | 84 |
| 85 | | - #if defined(HAS_VARIADIC_TEMPLATES) | 86 | | - template <typename... T> | 87 | | - SEXP operator()(const T&... args) const { | | 85 | + template <typename... T> | | 86 | + SEXP operator()(const T&... args) const { | 88 | 87 | return invoke(pairlist(args...), R_GlobalEnv); | 89 | | - } | 90 | | - #else | 91 | | - #include <Rcpp/generated/Function__operator.h> | 92 | | - #endif | | 88 | + } | 93 | 89 |
| 94 | 90 | /** | 95 | 91 | * Returns the environment of this function | |
Collapse file Copy file name to clipboardExpand all lines: inst/include/Rcpp/InternalFunction.h -6Lines changed: 0 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 26 | 26 |
| 27 | 27 | #include <Rcpp/grow.h> | 28 | 28 |
| 29 | | -#ifdef RCPP_USING_CXX11 | 30 | 29 | #include <Rcpp/InternalFunctionWithStdFunction.h> | 31 | | -#endif | 32 | 30 |
| 33 | 31 | namespace Rcpp{ | 34 | 32 |
| @@ -37,7 +35,6 @@ namespace Rcpp{ | 37 | 35 |
| 38 | 36 | RCPP_GENERATE_CTOR_ASSIGN(InternalFunction_Impl) | 39 | 37 |
| 40 | | -#ifdef RCPP_USING_CXX11 | 41 | 38 | template <typename RESULT_TYPE, typename... Args> | 42 | 39 | InternalFunction_Impl(const std::function<RESULT_TYPE(Args...)> &fun) { | 43 | 40 | set( | @@ -51,9 +48,6 @@ namespace Rcpp{ | 51 | 48 | InternalFunction_Impl(RESULT_TYPE (*fun)(T...)) { | 52 | 49 | set(XPtr<CppFunctionN<RESULT_TYPE, T...> >(new CppFunctionN<RESULT_TYPE, T...>(fun), true)); | 53 | 50 | } | 54 | | -#else | 55 | | - #include <Rcpp/generated/InternalFunction__ctors.h> | 56 | | -#endif | 57 | 51 |
| 58 | 52 | void update(SEXP){} | 59 | 53 | private: | |
Collapse file Copy file name to clipboardExpand all lines: inst/include/Rcpp/InternalFunctionWithStdFunction.h +2-8Lines changed: 2 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- | 2 | 1 | // | 3 | 2 | // InternalFunction_with_std_function.h: Rcpp R/C++ interface class library -- exposing C++ std::function's | 4 | 3 | // | 5 | | -// Copyright (C) 2014 Christian Authmann | 6 | | -// Copyright (C) 2015 Romain Francois and Dirk Eddelbuettel | | 4 | +// Copyright (C) 2014 - 2025 Christian Authmann | | 5 | +// Copyright (C) 2015 - 2025 Romain Francois and Dirk Eddelbuettel | 7 | 6 | // | 8 | 7 | // This file is part of Rcpp. | 9 | 8 | // | | 23 | 22 | #ifndef Rcpp_InternalFunctionWithStdFunction_h | 24 | 23 | #define Rcpp_InternalFunctionWithStdFunction_h | 25 | 24 |
| 26 | | -#if defined(HAS_VARIADIC_TEMPLATES) | 27 | 25 | #include <Rcpp/internal/call.h> | 28 | | -#endif | 29 | 26 | #include <functional> | 30 | 27 |
| 31 | 28 | namespace Rcpp { | 32 | 29 |
| 33 | 30 | namespace InternalFunctionWithStdFunction { | 34 | | - #if !defined(HAS_VARIADIC_TEMPLATES) && !defined(RCPP_USING_CXX11) | 35 | | - #include <Rcpp/generated/InternalFunctionWithStdFunction_call.h> | 36 | | - #endif | 37 | 31 |
| 38 | 32 | template <typename RESULT_TYPE, typename... Args> | 39 | 33 | class CppFunctionBaseFromStdFunction : public CppFunctionBase { | |
Collapse file Copy file name to clipboardExpand all lines: inst/include/Rcpp/Language.h +9-13Lines changed: 9 additions & 13 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 |
| 2 | 2 | // Language.h: Rcpp R/C++ interface class library -- language objects (calls) | 3 | 3 | // | 4 | | -// Copyright (C) 2010 - 2022 Dirk Eddelbuettel and Romain Francois | | 4 | +// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois | 5 | 5 | // | 6 | 6 | // This file is part of Rcpp. | 7 | 7 | // | @@ -102,19 +102,15 @@ namespace Rcpp{ | 102 | 102 | * 0.0 is wrapped as a numeric vector using wrap( const& double ) | 103 | 103 | * ... | 104 | 104 | */ | 105 | | - #if defined(HAS_VARIADIC_TEMPLATES) | 106 | | - template <typename... T> | 107 | | - Language_Impl(const std::string& symbol, const T&... t) { | 108 | | - Storage::set__(pairlist(Rf_install(symbol.c_str()), t...) ); | 109 | | - } | | 105 | + template <typename... T> | | 106 | + Language_Impl(const std::string& symbol, const T&... t) { | | 107 | + Storage::set__(pairlist(Rf_install(symbol.c_str()), t...) ); | | 108 | + } | 110 | 109 |
| 111 | | - template <typename... T> | 112 | | - Language_Impl(const Function& function, const T&... t) { | 113 | | - Storage::set__(pairlist(function, t...)); | 114 | | - } | 115 | | - #else | 116 | | - #include <Rcpp/generated/Language__ctors.h> | 117 | | - #endif | | 110 | + template <typename... T> | | 111 | + Language_Impl(const Function& function, const T&... t) { | | 112 | + Storage::set__(pairlist(function, t...)); | | 113 | + } | 118 | 114 |
| 119 | 115 | /** | 120 | 116 | * sets the symbol of the call | |
Collapse file Copy file name to clipboardExpand all lines: inst/include/Rcpp/Module.h +8-25Lines changed: 8 additions & 25 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 |
| 2 | 2 | // Module.h: Rcpp R/C++ interface class library -- Rcpp modules | 3 | 3 | // | 4 | | -// Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois | | 4 | +// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois | 5 | 5 | // | 6 | 6 | // This file is part of Rcpp. | 7 | 7 | // | @@ -86,7 +86,6 @@ namespace Rcpp{ | 86 | 86 | #include <Rcpp/module/CppFunction.h> | 87 | 87 | #include <Rcpp/module/get_return_type.h> | 88 | 88 |
| 89 | | -#if defined(HAS_VARIADIC_TEMPLATES) | 90 | 89 | namespace Rcpp { | 91 | 90 | template <typename RESULT_TYPE, typename... T> | 92 | 91 | inline void signature(std::string& s, const char* name) { | @@ -132,11 +131,7 @@ namespace Rcpp { | 132 | 131 | Rcpp::List formals; | 133 | 132 | }; | 134 | 133 | } | 135 | | -#else | 136 | | - #include <Rcpp/module/Module_generated_get_signature.h> | 137 | | - // templates CppFunction0, ..., CppFunction65 | 138 | | - #include <Rcpp/module/Module_generated_CppFunction.h> | 139 | | -#endif | | 134 | + | 140 | 135 | #include <Rcpp/module/class_Base.h> | 141 | 136 | #include <Rcpp/module/Module.h> | 142 | 137 |
| @@ -177,7 +172,7 @@ namespace Rcpp{ | 177 | 172 | private: | 178 | 173 | ParentMethod* parent_method_pointer ; | 179 | 174 | } ; | 180 | | -#if defined(HAS_VARIADIC_TEMPLATES) | | 175 | + | 181 | 176 | template <typename... T> | 182 | 177 | inline void ctor_signature(std::string& s, const std::string& classname) { | 183 | 178 | s.assign(classname); | @@ -251,13 +246,6 @@ namespace Rcpp{ | 251 | 246 | return nargs == n ; | 252 | 247 | } | 253 | 248 |
| 254 | | -#else | 255 | | -#include <Rcpp/module/Module_generated_ctor_signature.h> | 256 | | -#include <Rcpp/module/Module_generated_Constructor.h> | 257 | | -#include <Rcpp/module/Module_generated_Factory.h> | 258 | | -#include <Rcpp/module/Module_generated_class_signature.h> | 259 | | -#endif | 260 | | - | 261 | 249 | typedef bool (*ValidConstructor)(SEXP*,int) ; | 262 | 250 | typedef bool (*ValidMethod)(SEXP*,int) ; | 263 | 251 |
| @@ -381,7 +369,7 @@ namespace Rcpp{ | 381 | 369 |
| 382 | 370 | } ; | 383 | 371 |
| 384 | | -#if defined(HAS_VARIADIC_TEMPLATES) | | 372 | + | 385 | 373 | template <bool IsConst,typename Class, typename RESULT_TYPE, typename... T> | 386 | 374 | class CppMethodImplN : public CppMethod<Class> { | 387 | 375 | public: | @@ -441,10 +429,8 @@ namespace Rcpp{ | 441 | 429 |
| 442 | 430 | template <typename Class, typename RESULT_TYPE, typename... T> | 443 | 431 | using Const_Pointer_CppMethodN = Pointer_CppMethodImplN<true, Class, RESULT_TYPE, T...>; | 444 | | -#else | 445 | | - #include <Rcpp/module/Module_generated_CppMethod.h> | 446 | | - #include <Rcpp/module/Module_generated_Pointer_CppMethod.h> | 447 | | -#endif | | 432 | + | | 433 | + | 448 | 434 |
| 449 | 435 | template <typename Class> | 450 | 436 | class CppProperty { | @@ -552,7 +538,7 @@ namespace Rcpp{ | 552 | 538 | } ; | 553 | 539 | } | 554 | 540 |
| 555 | | -#if defined(HAS_VARIADIC_TEMPLATES) | | 541 | + | 556 | 542 | namespace Rcpp { | 557 | 543 | template <typename RESULT_TYPE, typename... T> | 558 | 544 | void function(const char* name_, RESULT_TYPE (*fun)(T... t), const char* docstring = 0) { | @@ -570,10 +556,7 @@ namespace Rcpp { | 570 | 556 | } | 571 | 557 | } | 572 | 558 | } | 573 | | -#else | 574 | | - // function factories | 575 | | - #include <Rcpp/module/Module_generated_function.h> | 576 | | -#endif | | 559 | + | 577 | 560 |
| 578 | 561 | namespace Rcpp { | 579 | 562 |
| |
Collapse file Copy file name to clipboardExpand all lines: inst/include/Rcpp/Pairlist.h +6-9Lines changed: 6 additions & 9 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 | // | 3 | 3 | // Pairlist.h: Rcpp R/C++ interface class library -- pair lists objects (LISTSXP) | 4 | 4 | // | 5 | | -// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois | | 5 | +// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois | 6 | 6 | // | 7 | 7 | // This file is part of Rcpp. | 8 | 8 | // | @@ -42,14 +42,11 @@ namespace Rcpp{ | 42 | 42 | Pairlist_Impl(SEXP x){ | 43 | 43 | Storage::set__(r_cast<LISTSXP>(x)) ; | 44 | 44 | } | 45 | | - #if defined(HAS_VARIADIC_TEMPLATES) | 46 | | - template <typename... T> | 47 | | - Pairlist_Impl(const T&... args ){ | 48 | | - Storage::set__(pairlist(args... )) ; | 49 | | - } | 50 | | - #else | 51 | | - #include <Rcpp/generated/Pairlist__ctors.h> | 52 | | - #endif | | 45 | + template <typename... T> | | 46 | + Pairlist_Impl(const T&... args ){ | | 47 | + Storage::set__(pairlist(args... )) ; | | 48 | + } | | 49 | + | 53 | 50 | void update(SEXP x) { | 54 | 51 | if (TYPEOF(x) != LISTSXP) { | 55 | 52 | Storage::set__(r_cast<LISTSXP>(x)); | |
|