]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/histogram/test/utility_axis.hpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / libs / histogram / test / utility_axis.hpp
CommitLineData
92f5a8d4
TL
1// Copyright 2018-2019 Hans Dembinski
2//
3// Distributed under the Boost Software License, Version 1.0.
4// (See accompanying file LICENSE_1_0.txt
5// or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7#ifndef BOOST_HISTOGRAM_TEST_UTILITY_AXIS_HPP
8#define BOOST_HISTOGRAM_TEST_UTILITY_AXIS_HPP
9
10#include <boost/core/lightweight_test.hpp>
11#include <boost/histogram/fwd.hpp>
12
13namespace boost {
14namespace histogram {
15
f67539c2
TL
16template <class Axis>
17void test_axis_iterator(const Axis& a, axis::index_type begin, axis::index_type end) {
92f5a8d4
TL
18 for (auto bin : a) {
19 BOOST_TEST_EQ(bin, a.bin(begin));
20 ++begin;
21 }
22 BOOST_TEST_EQ(begin, end);
23 auto rit = a.rbegin();
24 for (; rit != a.rend(); ++rit) {
25 --begin;
26 BOOST_TEST_EQ(*rit, a.bin(begin));
27 }
28}
29
30namespace axis {
31bool operator==(const null_type&, const null_type&) { return true; }
32} // namespace axis
33
34} // namespace histogram
35} // namespace boost
36
37#endif