fix: Boolean axes missing options() method (#283)

This commit is contained in:
Henry Schreiner 2020-07-05 02:45:18 -04:00 committed by GitHub
parent 5e60e86d3c
commit 302c72dc72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -9,6 +9,7 @@
#include <boost/core/nvp.hpp>
#include <boost/histogram/axis/iterator.hpp>
#include <boost/histogram/axis/option.hpp>
#include <boost/histogram/axis/metadata_base.hpp>
#include <boost/histogram/detail/relaxed_equal.hpp>
#include <boost/histogram/detail/replace_type.hpp>
@ -39,6 +40,8 @@ public:
static constexpr bool inclusive() noexcept { return true; }
static constexpr unsigned options() noexcept { return option::none_t::value; }
template <class M>
bool operator==(const boolean<M>& o) const noexcept {
return detail::relaxed_equal{}(this->metadata(), o.metadata());

View File

@ -36,6 +36,8 @@ int main() {
BOOST_TEST_EQ(a.index(1), 1);
BOOST_TEST_EQ(a.index(0), 0);
BOOST_TEST_EQ(a.options(), axis::option::none_t::value);
BOOST_TEST_CSTR_EQ(str(a).c_str(), "boolean(metadata=\"foo\")");
axis::boolean<> b;