...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::histogram::axis::boolean — Discrete axis for boolean data.
// In header: <boost/histogram/axis/boolean.hpp> template<typename MetaData> class boolean : public boost::histogram::axis::iterator_mixin< boolean< MetaData > >, public metadata_base_t< MetaData > { public: // public member functions explicit boolean(metadata_type = {}) noexcept(std::is_nothrow_move_constructible< metadata_type >::value); index_type index(value_type) const noexcept; value_type value(index_type) const noexcept; value_type bin(index_type) const noexcept; index_type size() const noexcept; template<typename M> bool operator==(const boolean< M > &) const noexcept; template<typename M> bool operator!=(const boolean< M > &) const noexcept; template<typename Archive> void serialize(Archive &, unsigned); // public static functions static constexpr bool inclusive() noexcept; static constexpr unsigned options() noexcept; };
Binning is a pass-though operation with zero cost, making this the fastest possible axis. The axis has no internal state apart from the optional metadata state. The axis has no under- and overflow bins. It cannot grow and cannot be reduced.
boolean
public member functionsexplicit boolean(metadata_type meta = {}) noexcept(std::is_nothrow_move_constructible< metadata_type >::value);Construct a boolean axis.
The constructor is nothrow if meta is nothrow move constructible.
Parameters: |
|
index_type index(value_type x) const noexcept;Return index for value argument.
value_type value(index_type i) const noexcept;Return value for index argument.
value_type bin(index_type i) const noexcept;Return bin for index argument.
index_type size() const noexcept;Returns the number of bins, without over- or underflow.
template<typename M> bool operator==(const boolean< M > & o) const noexcept;
template<typename M> bool operator!=(const boolean< M > & o) const noexcept;
template<typename Archive> void serialize(Archive & ar, unsigned);
boolean
public static functionsstatic constexpr bool inclusive() noexcept;Whether the axis is inclusive (see axis::traits::is_inclusive).
static constexpr unsigned options() noexcept;Returns the options.