File indexing completed on 2025-01-18 09:38:10
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_HISTOGRAM_AXIS_OPTION_HPP
0008 #define BOOST_HISTOGRAM_AXIS_OPTION_HPP
0009
0010 #include <type_traits>
0011
0012
0013
0014
0015
0016
0017
0018
0019 namespace boost {
0020 namespace histogram {
0021 namespace axis {
0022 namespace option {
0023
0024
0025 template <unsigned Bits>
0026 struct bitset : std::integral_constant<unsigned, Bits> {
0027
0028
0029 template <unsigned B>
0030 static constexpr auto test(bitset<B>) {
0031
0032 return std::integral_constant<bool, static_cast<bool>((Bits & B) == (B + 0))>{};
0033 }
0034 };
0035
0036
0037 template <unsigned B1, unsigned B2>
0038 constexpr auto operator|(bitset<B1>, bitset<B2>) {
0039 return bitset<(B1 | B2)>{};
0040 }
0041
0042
0043 template <unsigned B1, unsigned B2>
0044 constexpr auto operator&(bitset<B1>, bitset<B2>) {
0045 return bitset<(B1 & B2)>{};
0046 }
0047
0048
0049 template <unsigned B1, unsigned B2>
0050 constexpr auto operator-(bitset<B1>, bitset<B2>) {
0051 return bitset<(B1 & ~B2)>{};
0052 }
0053
0054
0055
0056
0057
0058
0059 template <unsigned Pos>
0060 #ifndef BOOST_HISTOGRAM_DOXYGEN_INVOKED
0061 using bit = bitset<(1 << Pos)>;
0062 #else
0063 struct bit;
0064 #endif
0065
0066
0067 using none_t = bitset<0>;
0068
0069 using underflow_t = bit<0>;
0070
0071 using overflow_t = bit<1>;
0072
0073 using circular_t = bit<2>;
0074
0075 using growth_t = bit<3>;
0076
0077 constexpr none_t none{};
0078 constexpr underflow_t underflow{};
0079 constexpr overflow_t overflow{};
0080 constexpr circular_t circular{};
0081 constexpr growth_t growth{};
0082
0083 }
0084 }
0085 }
0086 }
0087
0088 #endif