mirror of
https://github.com/boostorg/histogram.git
synced 2026-01-29 07:32:23 +00:00
fix
This commit is contained in:
@@ -21,7 +21,7 @@ addons:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- libstdc++6
|
||||
- libstdc++5-dev libgcc-5-dev libstdc++6
|
||||
|
||||
matrix:
|
||||
include:
|
||||
|
||||
@@ -27,6 +27,14 @@ namespace boost {
|
||||
namespace histogram {
|
||||
|
||||
namespace detail {
|
||||
struct is_continuous : public boost::static_visitor<bool> {
|
||||
template <typename A>
|
||||
bool operator()(const A&) const {
|
||||
using T = detail::arg_type<decltype(&A::value)>;
|
||||
return !std::is_integral<T>::value;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename F, typename R>
|
||||
struct functor_wrapper : public boost::static_visitor<R> {
|
||||
F& fcn;
|
||||
@@ -205,13 +213,9 @@ public:
|
||||
}
|
||||
|
||||
decltype(auto) operator[](const int idx) const {
|
||||
const bool is_continuous = visit(
|
||||
[](const auto& a) {
|
||||
using A = detail::rm_cvref<decltype(a)>;
|
||||
using T = detail::arg_type<decltype(&A::value)>;
|
||||
return !std::is_integral<T>::value;
|
||||
},
|
||||
*this);
|
||||
// using visit here causes internal error in MSVC 2017
|
||||
const bool is_continuous = boost::apply_visitor(detail::is_continuous(),
|
||||
static_cast<const base_type&>(*this));
|
||||
return polymorphic_bin_view<variant>(idx, *this, is_continuous);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user