// Copyright 2018 Hans Dembinski // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_HISTOGRAM_TEST_UTILITY_HISTOGRAM_HPP #define BOOST_HISTOGRAM_TEST_UTILITY_HISTOGRAM_HPP #include #include #include #include #include #include #include #include #include namespace boost { namespace histogram { template auto make_axis_vector(const Ts&... ts) { // make sure the variant is never trivial (contains only one type) using R = axis::regular; using I = axis::integer; using V = axis::variable; using C = axis::category; using Var = boost::mp11::mp_unique>; return std::vector({Var(ts)...}); } using static_tag = std::false_type; using dynamic_tag = std::true_type; template auto make(static_tag, const Axes&... axes) { return make_histogram(axes...); } template auto make_s(static_tag, S&& s, const Axes&... axes) { return make_histogram_with(s, axes...); } template auto make(dynamic_tag, const Axes&... axes) { return make_histogram(make_axis_vector(axes...)); } template auto make_s(dynamic_tag, S&& s, const Axes&... axes) { return make_histogram_with(s, make_axis_vector(axes...)); } } // namespace histogram } // namespace boost #endif