| 64 | }; |
| 65 | |
| 66 | struct lower_visitor : public boost::static_visitor<double> { |
| 67 | int idx; |
| 68 | lower_visitor(int i) : idx(i) {} |
| 69 | template <typename Axis> |
| 70 | double operator()(const Axis& a) const { |
| 71 | return impl( |
| 72 | std::integral_constant< |
| 73 | bool, (std::is_convertible<typename Axis::value_type, double>::value && |
| 74 | std::is_same<typename Axis::bin_type, interval_view<Axis>>::value)>(), |
| 75 | a); |
| 76 | } |
| 77 | template <typename Axis> |
| 78 | double impl(std::true_type, const Axis& a) const { |
| 79 | return a.lower(idx); |
| 80 | } |
| 81 | template <typename Axis> |
| 82 | double impl(std::false_type, const Axis&) const { |
| 83 | throw std::runtime_error(boost::histogram::detail::cat( |
| 84 | "cannot use ", boost::typeindex::type_id<Axis>().pretty_name(), |
| 85 | " with generic boost::histogram::axis::any interface, use" |
| 86 | " a static_cast to access the underlying axis type")); |
| 87 | } |
| 88 | }; |
| 89 | |
| 90 | struct bicmp_visitor : public boost::static_visitor<bool> { |
| 91 | template <typename T, typename U> |