remove some workarounds

This commit is contained in:
Hans Dembinski 2019-10-26 14:02:15 +02:00 committed by GitHub
parent 4c1caf3462
commit 469a866ee6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 33 deletions

View File

@ -298,10 +298,9 @@ auto fill(const std::size_t offset, S& storage, A& axes, const Args& args) {
return fill_2(growing{}, offset, storage, axes,
pack_args<pos::start, pos::nargs>(typename pos::weight{},
typename pos::sample{}, args));
else
return (BOOST_THROW_EXCEPTION(
std::invalid_argument("number of arguments != histogram rank")),
storage.end());
return (BOOST_THROW_EXCEPTION(
std::invalid_argument("number of arguments != histogram rank")),
storage.end());
}
#if BOOST_WORKAROUND(BOOST_MSVC, >= 0)

View File

@ -8,7 +8,7 @@
#define BOOST_HISTOGRAM_DETAIL_LINEARIZE_HPP
#include <boost/assert.hpp>
#include <boost/config/workaround.hpp>
#include <boost/config.hpp>
#include <boost/histogram/axis/option.hpp>
#include <boost/histogram/axis/traits.hpp>
#include <boost/histogram/axis/variant.hpp>
@ -19,17 +19,18 @@ namespace boost {
namespace histogram {
namespace detail {
#if BOOST_WORKAROUND(BOOST_MSVC, >= 0)
#pragma warning(disable : 4127) // disable "warning" about using if constexpr
#endif
// initial offset to out must be set
template <class Index, class Opts>
std::size_t linearize(Opts, Index& out, const std::size_t stride,
const axis::index_type size, const axis::index_type idx) {
constexpr bool u = Opts::test(axis::option::underflow);
constexpr bool o = Opts::test(axis::option::overflow);
if (std::is_same<Index, std::size_t>::value || (u && o)) {
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
if
#else
if constexpr
#endif
(std::is_same<Index, std::size_t>::value || (u && o)) {
BOOST_ASSERT(idx >= (u ? -1 : 0));
BOOST_ASSERT(idx < (o ? size + 1 : size));
BOOST_ASSERT(idx >= 0 || static_cast<std::size_t>(-idx * stride) <= out);
@ -45,10 +46,6 @@ std::size_t linearize(Opts, Index& out, const std::size_t stride,
return size + u + o;
}
#if BOOST_WORKAROUND(BOOST_MSVC, >= 0)
#pragma warning(default : 4127)
#endif
template <class Index, class Axis, class Value>
std::size_t linearize(Index& out, const std::size_t stride, const Axis& ax,
const Value& v) {

View File

@ -29,11 +29,6 @@ enum class coverage {
all, /*!< iterate over all bins, including underflow and overflow */
};
#if BOOST_WORKAROUND(BOOST_CLANG, >= 0)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wc++17-extensions"
#endif
/** Input iterator range over histogram bins with multi-dimensional index.
The iterator returned by begin() can only be incremented. begin() may only be called
@ -321,10 +316,6 @@ private:
iterator begin_, end_;
};
#if BOOST_WORKAROUND(BOOST_CLANG, >= 0)
#pragma GCC diagnostic pop
#endif
/** Generates an indexed range of <a
href="https://en.cppreference.com/w/cpp/named_req/ForwardIterator">forward iterators</a>
over the histogram cells.

View File

@ -10,7 +10,7 @@
#include <algorithm>
#include <boost/assert.hpp>
#include <boost/config/workaround.hpp>
#include <boost/config.hpp>
#include <boost/core/alloc_construct.hpp>
#include <boost/core/exchange.hpp>
#include <boost/core/nvp.hpp>
@ -434,10 +434,6 @@ public:
// template <class Allocator>
// unlimited_storage(const unlimited_storage<Allocator>& s)
#if BOOST_WORKAROUND(BOOST_MSVC, >= 0)
#pragma warning(disable : 4127) // disable "warning" about using if constexpr
#endif
template <class Iterable, class = detail::requires_iterable<Iterable>>
explicit unlimited_storage(const Iterable& s) {
using std::begin;
@ -448,16 +444,17 @@ public:
constexpr auto ti = buffer_type::template type_index<V>();
constexpr auto nt = mp11::mp_size<typename buffer_type::types>::value;
const std::size_t size = static_cast<std::size_t>(std::distance(s_begin, s_end));
if (ti < nt)
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
if
#else
if constexpr
#endif
(ti < nt)
buffer_.template make<V>(size, s_begin);
else
buffer_.template make<double>(size, s_begin);
}
#if BOOST_WORKAROUND(BOOST_MSVC, >= 0)
#pragma warning(default : 4127)
#endif
template <class Iterable, class = detail::requires_iterable<Iterable>>
unlimited_storage& operator=(const Iterable& s) {
*this = unlimited_storage(s);