12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #ifndef BOOST_HISTOGRAM_AXIS_OPTION_HPP
- #define BOOST_HISTOGRAM_AXIS_OPTION_HPP
- #include <type_traits>
- namespace boost {
- namespace histogram {
- namespace axis {
- namespace option {
- template <unsigned Bits>
- struct bitset : std::integral_constant<unsigned, Bits> {
-
- template <unsigned B>
- static constexpr auto test(bitset<B>) {
-
- return std::integral_constant<bool, static_cast<bool>((Bits & B) == (B + 0))>{};
- }
- };
- template <unsigned B1, unsigned B2>
- constexpr auto operator|(bitset<B1>, bitset<B2>) {
- return bitset<(B1 | B2)>{};
- }
- template <unsigned B1, unsigned B2>
- constexpr auto operator&(bitset<B1>, bitset<B2>) {
- return bitset<(B1 & B2)>{};
- }
- template <unsigned B1, unsigned B2>
- constexpr auto operator-(bitset<B1>, bitset<B2>) {
- return bitset<(B1 & ~B2)>{};
- }
- template <unsigned Pos>
- #ifndef BOOST_HISTOGRAM_DOXYGEN_INVOKED
- using bit = bitset<(1 << Pos)>;
- #else
- struct bit;
- #endif
- using none_t = bitset<0>;
- using underflow_t = bit<0>;
- using overflow_t = bit<1>;
- using circular_t = bit<2>;
- using growth_t = bit<3>;
- constexpr none_t none{};
- constexpr underflow_t underflow{};
- constexpr overflow_t overflow{};
- constexpr circular_t circular{};
- constexpr growth_t growth{};
- }
- }
- }
- }
- #endif
|