Commit 9a460a2 1 parent e0bc82c commit 9a460a2 Copy full SHA for 9a460a2
File tree 3 files changed +18
-16
lines changed
3 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -88,16 +88,4 @@ void Cuts::AddCuts(const std::vector<SimpleCut>& cuts) {
88
88
}
89
89
}
90
90
91
- template <typename ... Args>
92
- Cuts::Cuts (std::string name, Args... args) : name_(std::move(name)) {
93
- // AddCuts(std::forward<Args>(args)...);
94
- AddCuts (args...);
95
- }
96
-
97
- template <typename T, typename ... Args>
98
- void Cuts::AddCuts (const T& t, const Args&... args) {
99
- AddCuts (t);
100
- AddCuts (args...);
101
- }
102
-
103
91
}// namespace AnalysisTree
Original file line number Diff line number Diff line change @@ -48,15 +48,27 @@ class Cuts {
48
48
}
49
49
}
50
50
51
- template <typename ... Args>
52
- explicit Cuts (std::string name, Args... args);
53
-
54
51
void AddCut (const SimpleCut& cut);
55
52
56
53
void AddCuts (const std::vector<SimpleCut>& cuts);
57
54
55
+ // Base case for variadic recursion (handles when there's just one argument left)
56
+ template <typename T>
57
+ void AddCuts (const T& t) {
58
+ AddCuts (t); // Call the appropriate overload for a single argument (like std::vector<SimpleCut>)
59
+ }
60
+
61
+ // Recursive case for variadic template (multiple arguments)
58
62
template <typename T, typename ... Args>
59
- void AddCuts (const T& t, const Args&... args);
63
+ void AddCuts (const T& t, const Args&... args) {
64
+ AddCuts (t);
65
+ AddCuts (args...);
66
+ }
67
+
68
+ template <typename ... Args>
69
+ Cuts (std::string name, Args... args) : name_(std::move(name)) {
70
+ AddCuts (args...);
71
+ }
60
72
61
73
/* *
62
74
* @brief Evaluates all SimpleCuts
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ TaskManager* TaskManager::GetInstance() {
22
22
23
23
void TaskManager::Init (const std::vector<std::string>& filelists, const std::vector<std::string>& in_trees) {
24
24
assert (!is_init_);
25
+ std::cout << " TaskManager::Init()\n " ;
25
26
is_init_ = true ;
26
27
read_in_tree_ = true ;
27
28
chain_ = new Chain (filelists, in_trees);
@@ -51,6 +52,7 @@ void TaskManager::InitTasks() {
51
52
52
53
void TaskManager::Init () {
53
54
assert (!is_init_);
55
+ std::cout << " TaskManager::Init()\n " ;
54
56
is_init_ = true ;
55
57
fill_out_tree_ = true ;
56
58
You can’t perform that action at this time.
0 commit comments