@@ -42,7 +42,8 @@ namespace o2::framework
42
42
struct HistFiller {
43
43
// fill any type of histogram (if weight was requested it must be the last argument)
44
44
template <typename T, typename ... Ts>
45
- static void fillHistAny (std::shared_ptr<T> hist, const Ts&... positionAndWeight);
45
+ static void fillHistAny (std::shared_ptr<T> hist, Ts... positionAndWeight)
46
+ requires(std::is_arithmetic_v<Ts> && ...);
46
47
47
48
// fill any type of histogram with columns (Cs) of a filtered table (if weight is requested it must reside the last specified column)
48
49
template <typename ... Cs, typename R, typename T>
@@ -127,7 +128,8 @@ class HistogramRegistry
127
128
128
129
// fill hist with values
129
130
template <typename ... Ts>
130
- void fill (const HistName& histName, Ts&&... positionAndWeight);
131
+ void fill (const HistName& histName, Ts... positionAndWeight)
132
+ requires(std::is_arithmetic_v<Ts> && ...);
131
133
132
134
// fill hist with content of (filtered) table columns
133
135
template <typename ... Cs, typename T>
@@ -197,7 +199,8 @@ class HistogramRegistry
197
199
// --------------------------------------------------------------------------------------------------
198
200
199
201
template <typename T, typename ... Ts>
200
- void HistFiller::fillHistAny (std::shared_ptr<T> hist, const Ts&... positionAndWeight)
202
+ void HistFiller::fillHistAny (std::shared_ptr<T> hist, Ts... positionAndWeight)
203
+ requires(std::is_arithmetic_v<Ts> && ...)
201
204
{
202
205
constexpr int nArgs = sizeof ...(Ts);
203
206
@@ -412,11 +415,16 @@ uint32_t HistogramRegistry::getHistIndex(const T& histName)
412
415
}
413
416
414
417
template <typename ... Ts>
415
- void HistogramRegistry::fill (const HistName& histName, Ts&&... positionAndWeight)
418
+ void HistogramRegistry::fill (const HistName& histName, Ts... positionAndWeight)
419
+ requires(std::is_arithmetic_v<Ts> && ...)
416
420
{
417
- std::visit ([& positionAndWeight...](auto && hist) { HistFiller::fillHistAny (hist, std::forward<Ts>( positionAndWeight) ...); }, mRegistryValue [getHistIndex (histName)]);
421
+ std::visit ([positionAndWeight...](auto && hist) { HistFiller::fillHistAny (hist, positionAndWeight...); }, mRegistryValue [getHistIndex (histName)]);
418
422
}
419
423
424
+ extern template void HistogramRegistry::fill (const HistName& histName, double );
425
+ extern template void HistogramRegistry::fill (const HistName& histName, float );
426
+ extern template void HistogramRegistry::fill (const HistName& histName, int );
427
+
420
428
template <typename ... Cs, typename T>
421
429
void HistogramRegistry::fill (const HistName& histName, const T& table, const o2::framework::expressions::Filter& filter)
422
430
{
0 commit comments