mirror of
https://github.com/boostorg/histogram.git
synced 2025-05-11 13:14:06 +00:00
small interface fix and adaptations to current boost develop
This commit is contained in:
parent
3e882bce26
commit
0583e6598d
@ -34,8 +34,10 @@ matrix:
|
|||||||
# ignore optional dependencies not currently supported by the cmake build
|
# ignore optional dependencies not currently supported by the cmake build
|
||||||
- python tools/boostdep/depinst/depinst.py --git_args "--depth 5 --jobs 3" histogram -N accumulators -N range -N serialization -N units
|
- python tools/boostdep/depinst/depinst.py --git_args "--depth 5 --jobs 3" histogram -N accumulators -N range -N serialization -N units
|
||||||
|
|
||||||
# WORKAROUND: throw_exception tests have dependencies that depinst.py misses
|
# WORKAROUND: some external tests have extra dependencies that depinst.py misses
|
||||||
- python tools/boostdep/depinst/depinst.py --git_args "--depth 5 --jobs 3" throw_exception
|
- python tools/boostdep/depinst/depinst.py --git_args "--depth 5 --jobs 3" throw_exception
|
||||||
|
- python tools/boostdep/depinst/depinst.py --git_args "--depth 5 --jobs 3" smart_ptr
|
||||||
|
- python tools/boostdep/depinst/depinst.py --git_args "--depth 5 --jobs 3" move
|
||||||
|
|
||||||
script:
|
script:
|
||||||
mkdir build && cd build &&
|
mkdir build && cd build &&
|
||||||
|
@ -15,12 +15,12 @@
|
|||||||
#include <boost/histogram/detail/static_if.hpp>
|
#include <boost/histogram/detail/static_if.hpp>
|
||||||
#include <boost/histogram/detail/try_cast.hpp>
|
#include <boost/histogram/detail/try_cast.hpp>
|
||||||
#include <boost/histogram/detail/type_name.hpp>
|
#include <boost/histogram/detail/type_name.hpp>
|
||||||
|
#include <boost/histogram/detail/variant2_with_warnings_disabled.hpp>
|
||||||
#include <boost/histogram/fwd.hpp>
|
#include <boost/histogram/fwd.hpp>
|
||||||
#include <boost/mp11/algorithm.hpp>
|
#include <boost/mp11/algorithm.hpp>
|
||||||
#include <boost/mp11/list.hpp>
|
#include <boost/mp11/list.hpp>
|
||||||
#include <boost/mp11/utility.hpp>
|
#include <boost/mp11/utility.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <boost/variant2/variant.hpp>
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
@ -14,11 +14,11 @@
|
|||||||
#include <boost/histogram/detail/relaxed_equal.hpp>
|
#include <boost/histogram/detail/relaxed_equal.hpp>
|
||||||
#include <boost/histogram/detail/static_if.hpp>
|
#include <boost/histogram/detail/static_if.hpp>
|
||||||
#include <boost/histogram/detail/type_name.hpp>
|
#include <boost/histogram/detail/type_name.hpp>
|
||||||
|
#include <boost/histogram/detail/variant2_with_warnings_disabled.hpp>
|
||||||
#include <boost/histogram/detail/variant_proxy.hpp>
|
#include <boost/histogram/detail/variant_proxy.hpp>
|
||||||
#include <boost/mp11/algorithm.hpp> // mp_contains
|
#include <boost/mp11/algorithm.hpp> // mp_contains
|
||||||
#include <boost/mp11/list.hpp> // mp_first
|
#include <boost/mp11/list.hpp> // mp_first
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <boost/variant2/variant.hpp>
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
@ -11,11 +11,18 @@
|
|||||||
#include <boost/mp11/algorithm.hpp>
|
#include <boost/mp11/algorithm.hpp>
|
||||||
#include <boost/mp11/function.hpp>
|
#include <boost/mp11/function.hpp>
|
||||||
#include <boost/mp11/utility.hpp>
|
#include <boost/mp11/utility.hpp>
|
||||||
#include <boost/variant2/variant.hpp>
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
// forward declaration
|
||||||
|
namespace boost {
|
||||||
|
namespace variant2 {
|
||||||
|
template <class...>
|
||||||
|
class variant;
|
||||||
|
} // namespace variant2
|
||||||
|
} // namespace boost
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace histogram {
|
namespace histogram {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
@ -19,12 +19,12 @@
|
|||||||
#include <boost/histogram/detail/optional_index.hpp>
|
#include <boost/histogram/detail/optional_index.hpp>
|
||||||
#include <boost/histogram/detail/span.hpp>
|
#include <boost/histogram/detail/span.hpp>
|
||||||
#include <boost/histogram/detail/static_if.hpp>
|
#include <boost/histogram/detail/static_if.hpp>
|
||||||
|
#include <boost/histogram/detail/variant2_with_warnings_disabled.hpp>
|
||||||
#include <boost/histogram/fwd.hpp>
|
#include <boost/histogram/fwd.hpp>
|
||||||
#include <boost/mp11/algorithm.hpp>
|
#include <boost/mp11/algorithm.hpp>
|
||||||
#include <boost/mp11/bind.hpp>
|
#include <boost/mp11/bind.hpp>
|
||||||
#include <boost/mp11/utility.hpp>
|
#include <boost/mp11/utility.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <boost/variant2/variant.hpp>
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
@ -7,8 +7,19 @@
|
|||||||
#ifndef BOOST_HISTOGRAM_DETAIL_SPAN_HPP
|
#ifndef BOOST_HISTOGRAM_DETAIL_SPAN_HPP
|
||||||
#define BOOST_HISTOGRAM_DETAIL_SPAN_HPP
|
#define BOOST_HISTOGRAM_DETAIL_SPAN_HPP
|
||||||
|
|
||||||
#if __cpp_constexpr >= 201603 && __cpp_deduction_guides >= 201703 && \
|
#ifdef __has_include
|
||||||
__cpp_lib_nonmember_container_access >= 201411 && __has_include(<span>)
|
#if __has_include(<version>)
|
||||||
|
#include <version>
|
||||||
|
#ifdef __cpp_lib_span
|
||||||
|
#if __cpp_lib_span >= 201902
|
||||||
|
#define BOOST_HISTOGRAM_DETAIL_HAS_STD_SPAN
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef BOOST_HISTOGRAM_DETAIL_HAS_STD_SPAN
|
||||||
|
|
||||||
#include <span>
|
#include <span>
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright 2019 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_DETAIL_VARIANT2_WITH_WARNINGS_DISABLED_HPP
|
||||||
|
#define BOOST_HISTOGRAM_DETAIL_VARIANT2_WITH_WARNINGS_DISABLED_HPP
|
||||||
|
|
||||||
|
#include <boost/config/workaround.hpp>
|
||||||
|
#if BOOST_WORKAROUND(BOOST_GCC, >= 5)
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wextra"
|
||||||
|
#endif
|
||||||
|
#include <boost/variant2/variant.hpp>
|
||||||
|
#if BOOST_WORKAROUND(BOOST_GCC, >= 5)
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
@ -489,10 +489,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Multiply all values with a scalar.
|
/// Multiply all values with a scalar.
|
||||||
template <class V = value_type>
|
template <class S = storage_type>
|
||||||
std::enable_if_t<(detail::has_operator_rmul<V, double>::value &&
|
std::enable_if_t<(detail::has_operator_rmul<S, double>::value == true), histogram&>
|
||||||
detail::has_operator_rmul<storage_type, double>::value == true),
|
|
||||||
histogram&>
|
|
||||||
operator*=(const double x) {
|
operator*=(const double x) {
|
||||||
// use special implementation of scaling if available
|
// use special implementation of scaling if available
|
||||||
storage_ *= x;
|
storage_ *= x;
|
||||||
@ -500,10 +498,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Multiply all values with a scalar.
|
/// Multiply all values with a scalar.
|
||||||
template <class V = value_type>
|
template <class S = storage_type>
|
||||||
std::enable_if_t<(detail::has_operator_rmul<V, double>::value &&
|
std::enable_if_t<(detail::has_operator_rmul<S, double>::value == false), histogram&>
|
||||||
detail::has_operator_rmul<storage_type, double>::value == false),
|
|
||||||
histogram&>
|
|
||||||
operator*=(const double x) {
|
operator*=(const double x) {
|
||||||
// generic implementation of scaling
|
// generic implementation of scaling
|
||||||
for (auto&& si : storage_) si *= x;
|
for (auto&& si : storage_) si *= x;
|
||||||
|
@ -14,12 +14,12 @@
|
|||||||
#include <boost/histogram/axis/category.hpp>
|
#include <boost/histogram/axis/category.hpp>
|
||||||
#include <boost/histogram/axis/integer.hpp>
|
#include <boost/histogram/axis/integer.hpp>
|
||||||
#include <boost/histogram/axis/ostream.hpp>
|
#include <boost/histogram/axis/ostream.hpp>
|
||||||
|
#include <boost/histogram/detail/variant2_with_warnings_disabled.hpp>
|
||||||
#include <boost/histogram/histogram.hpp>
|
#include <boost/histogram/histogram.hpp>
|
||||||
#include <boost/histogram/literals.hpp>
|
#include <boost/histogram/literals.hpp>
|
||||||
#include <boost/histogram/make_histogram.hpp>
|
#include <boost/histogram/make_histogram.hpp>
|
||||||
#include <boost/histogram/ostream.hpp>
|
#include <boost/histogram/ostream.hpp>
|
||||||
#include <boost/histogram/storage_adaptor.hpp>
|
#include <boost/histogram/storage_adaptor.hpp>
|
||||||
#include <boost/variant2/variant.hpp>
|
|
||||||
#include <random>
|
#include <random>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
@ -92,7 +92,7 @@ void run_tests(const std::vector<int>& x, const std::vector<int>& y,
|
|||||||
h(1);
|
h(1);
|
||||||
for (auto&& xi : x) h(xi);
|
for (auto&& xi : x) h(xi);
|
||||||
// uses variant
|
// uses variant
|
||||||
boost::variant2::variant<int, std::vector<int>, std::string> v[1];
|
variant<int, std::vector<int>, std::string> v[1];
|
||||||
v[0] = 1;
|
v[0] = 1;
|
||||||
h2.fill(v);
|
h2.fill(v);
|
||||||
v[0] = x;
|
v[0] = x;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user