bug fix of indexed for array storage

This commit is contained in:
Hans Dembinski 2019-10-30 09:26:54 +01:00 committed by GitHub
parent 1ff14e723c
commit 3923472642
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -14,6 +14,7 @@
#include <boost/histogram/detail/iterator_adaptor.hpp>
#include <boost/histogram/detail/operators.hpp>
#include <boost/histogram/fwd.hpp>
#include <iterator>
#include <type_traits>
#include <utility>
@ -43,9 +44,11 @@ private:
detail::buffer_size<typename std::remove_const_t<histogram_type>::axes_type>::value;
public:
using value_iterator = decltype(std::declval<histogram_type>().begin());
using value_reference = typename value_iterator::reference;
using value_type = typename value_iterator::value_type;
using value_iterator = std::conditional_t<std::is_const<histogram_type>::value,
typename histogram_type::const_iterator,
typename histogram_type::iterator>;
using value_reference = typename std::iterator_traits<value_iterator>::reference;
using value_type = typename std::iterator_traits<value_iterator>::value_type;
class iterator;
using range_iterator = iterator; ///< deprecated

View File

@ -124,7 +124,7 @@ template <class IsDynamic, class Coverage>
void run_stdlib_tests(mp_list<IsDynamic, Coverage>) {
auto ax = axis::regular<>(3, 0, 1);
auto ay = axis::integer<>(0, 2);
auto h = make_s(IsDynamic(), std::vector<int>(), ax, ay);
auto h = make_s(IsDynamic(), std::array<int, 20>(), ax, ay);
struct generator {
int i = 0;