| 8 | // example of a generic function for histograms, this one sums all entries |
| 9 | template <typename... Ts> |
| 10 | typename bh::histogram<Ts...>::element_type sum( |
| 11 | const bh::histogram<Ts...>& h) { |
| 12 | auto result = typename bh::histogram<Ts...>::element_type(0); |
| 13 | for (auto x : h) result += x; |
| 14 | return result; |
| 15 | } |
| 16 | |
| 17 | int main() { |
| 18 | using namespace bh::literals; // enables _c suffix |