| Home | Libraries | People | FAQ | More

## Class template boolean

boost::histogram::axis::boolean — Discrete axis for boolean data.

## Synopsis

    // 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 = {});
      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 bool inclusive() noexcept;
      static unsigned options() noexcept;
    };

## Description

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.

### Template Parameters

1.     typename MetaData

   type to store meta data.

### `boolean` public member functions

1.     explicit boolean(metadata_type meta = {});

   Construct a boolean axis.

   The constructor is nothrow if meta is nothrow move constructible.

   Parameters: |
   `meta` | description of the axis.

2.     index_type index(value_type x) const noexcept;

   Return index for value argument.

3.     value_type value(index_type i) const noexcept;

   Return value for index argument.

4.     value_type bin(index_type i) const noexcept;

   Return bin for index argument.

5.     index_type size() const noexcept;

   Returns the number of bins, without over- or underflow.

6.     template<typename M> bool operator==(const boolean< M > & o) const noexcept;

7.     template<typename M> bool operator!=(const boolean< M > & o) const noexcept;

8.     template<typename Archive> void serialize(Archive & ar, unsigned);

### `boolean` public static functions

1.     static bool inclusive() noexcept;

   Whether the axis is inclusive (see axis::traits::is_inclusive).

2.     static unsigned options() noexcept;

   Returns the options.