Skip to content

Commit 2b3a93c

Browse files
committed
Use variadic templates unconditionally in Module.h
Remove nine generated files
1 parent bf2ede8 commit 2b3a93c

11 files changed

+18
-46863
lines changed

ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* inst/include/Rcpp/Function.h: Idem
88
* inst/include/Rcpp/internal/call.h: Idem
99
* inst/include/Rcpp/InternalFunctionWithStdFunction.h: Idem
10+
* inst/include/Rcpp/Module.h: Idem
1011

1112
* inst/include/Rcpp/module/Module_generated_class_constructor.h: Removed
1213
* inst/include/Rcpp/module/Module_generated_class_factory.h: Idem
@@ -17,6 +18,15 @@
1718
* inst/include/Rcpp/generated/Vector__create.h: Idem
1819
* inst/include/Rcpp/generated/Function__operator.h: Idem
1920
* inst/include/Rcpp/generated/InternalFunctionWithStdFunction_call.h: Idem
21+
* inst/include/Rcpp/module/Module_generated_Constructor.h: Idem
22+
* inst/include/Rcpp/module/Module_generated_CppFunction.h: Idem
23+
* inst/include/Rcpp/module/Module_generated_CppMethod.h: Idem
24+
* inst/include/Rcpp/module/Module_generated_Factory.h: Idem
25+
* inst/include/Rcpp/module/Module_generated_Pointer_CppMethod.h: Idem
26+
* inst/include/Rcpp/module/Module_generated_class_signature.h: Idem
27+
* inst/include/Rcpp/module/Module_generated_ctor_signature.h: Idem
28+
* inst/include/Rcpp/module/Module_generated_function.h: Idem
29+
* inst/include/Rcpp/module/Module_generated_get_signature.h: Idem
2030

2131
2025-03-15 Dirk Eddelbuettel <[email protected]>
2232

inst/include/Rcpp/Module.h

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
// Module.h: Rcpp R/C++ interface class library -- Rcpp modules
33
//
4-
// Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois
4+
// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois
55
//
66
// This file is part of Rcpp.
77
//
@@ -86,7 +86,6 @@ namespace Rcpp{
8686
#include <Rcpp/module/CppFunction.h>
8787
#include <Rcpp/module/get_return_type.h>
8888

89-
#if defined(HAS_VARIADIC_TEMPLATES)
9089
namespace Rcpp {
9190
template <typename RESULT_TYPE, typename... T>
9291
inline void signature(std::string& s, const char* name) {
@@ -132,11 +131,7 @@ namespace Rcpp {
132131
Rcpp::List formals;
133132
};
134133
}
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+
140135
#include <Rcpp/module/class_Base.h>
141136
#include <Rcpp/module/Module.h>
142137

@@ -177,7 +172,7 @@ namespace Rcpp{
177172
private:
178173
ParentMethod* parent_method_pointer ;
179174
} ;
180-
#if defined(HAS_VARIADIC_TEMPLATES)
175+
181176
template <typename... T>
182177
inline void ctor_signature(std::string& s, const std::string& classname) {
183178
s.assign(classname);
@@ -251,13 +246,6 @@ namespace Rcpp{
251246
return nargs == n ;
252247
}
253248

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-
261249
typedef bool (*ValidConstructor)(SEXP*,int) ;
262250
typedef bool (*ValidMethod)(SEXP*,int) ;
263251

@@ -381,7 +369,7 @@ namespace Rcpp{
381369

382370
} ;
383371

384-
#if defined(HAS_VARIADIC_TEMPLATES)
372+
385373
template <bool IsConst,typename Class, typename RESULT_TYPE, typename... T>
386374
class CppMethodImplN : public CppMethod<Class> {
387375
public:
@@ -441,10 +429,8 @@ namespace Rcpp{
441429

442430
template <typename Class, typename RESULT_TYPE, typename... T>
443431
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+
448434

449435
template <typename Class>
450436
class CppProperty {
@@ -552,7 +538,7 @@ namespace Rcpp{
552538
} ;
553539
}
554540

555-
#if defined(HAS_VARIADIC_TEMPLATES)
541+
556542
namespace Rcpp {
557543
template <typename RESULT_TYPE, typename... T>
558544
void function(const char* name_, RESULT_TYPE (*fun)(T... t), const char* docstring = 0) {
@@ -570,10 +556,7 @@ namespace Rcpp {
570556
}
571557
}
572558
}
573-
#else
574-
// function factories
575-
#include <Rcpp/module/Module_generated_function.h>
576-
#endif
559+
577560

578561
namespace Rcpp {
579562

inst/include/Rcpp/module/Module_generated_Constructor.h

Lines changed: 0 additions & 148 deletions
This file was deleted.

0 commit comments

Comments
 (0)