15 #ifndef ROOT7_RHistUtils
16 #define ROOT7_RHistUtils
19 #include <type_traits>
22 namespace Experimental {
25 template <
int DIMENSIONS>
26 struct RCoordArray: std::array<double, DIMENSIONS> {
27 using Base_t = std::array<double, DIMENSIONS>;
30 RCoordArray() =
default;
33 template<
class...ELEMENTS,
class =
typename std::enable_if<
sizeof...(ELEMENTS) + 1 == DIMENSIONS>::type>
34 RCoordArray(
double x, ELEMENTS...el): Base_t{{x, el...}} {}
38 template<
class T,
class...ELEMENTS,
class =
typename std::enable_if<
sizeof...(ELEMENTS) + 1 != DIMENSIONS>::type>
39 RCoordArray(T, ELEMENTS...) {
40 static_assert(
sizeof...(ELEMENTS) + 1 == DIMENSIONS,
"Number of coordinates does not match DIMENSIONS");
44 RCoordArray(
double (&arr)[DIMENSIONS]): Base_t(arr) {}
48 RCoordArray(
const std::array<double, DIMENSIONS>& arr): Base_t(arr) {}
51 template <
int DIMENSIONS>
53 using CoordArray_t = RCoordArray<DIMENSIONS>;
60 #endif //ROOT7_THistUtils_h