diff --git a/.travis.yml b/.travis.yml index da8cba5b..f9fd31fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ addons: sources: - ubuntu-toolchain-r-test packages: - - libstdc++6 + - libstdc++5-dev libgcc-5-dev libstdc++6 matrix: include: diff --git a/include/boost/histogram/axis/variant.hpp b/include/boost/histogram/axis/variant.hpp index 9a70274e..16687c6f 100644 --- a/include/boost/histogram/axis/variant.hpp +++ b/include/boost/histogram/axis/variant.hpp @@ -27,6 +27,14 @@ namespace boost { namespace histogram { namespace detail { +struct is_continuous : public boost::static_visitor { + template + bool operator()(const A&) const { + using T = detail::arg_type; + return !std::is_integral::value; + } +}; + template struct functor_wrapper : public boost::static_visitor { 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; - using T = detail::arg_type; - return !std::is_integral::value; - }, - *this); + // using visit here causes internal error in MSVC 2017 + const bool is_continuous = boost::apply_visitor(detail::is_continuous(), + static_cast(*this)); return polymorphic_bin_view(idx, *this, is_continuous); }