File indexing completed on 2025-01-30 09:35:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef BOOST_BITMASK_HPP
0018 #define BOOST_BITMASK_HPP
0019
0020 #include <boost/config.hpp>
0021 #include <boost/cstdint.hpp>
0022
0023 #define BOOST_BITMASK(Bitmask) \
0024 \
0025 inline BOOST_CONSTEXPR Bitmask operator| (Bitmask x , Bitmask y ) \
0026 { return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
0027 | static_cast<boost::int_least32_t>(y)); } \
0028 \
0029 inline BOOST_CONSTEXPR Bitmask operator& (Bitmask x , Bitmask y ) \
0030 { return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
0031 & static_cast<boost::int_least32_t>(y)); } \
0032 \
0033 inline BOOST_CONSTEXPR Bitmask operator^ (Bitmask x , Bitmask y ) \
0034 { return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
0035 ^ static_cast<boost::int_least32_t>(y)); } \
0036 \
0037 inline BOOST_CONSTEXPR Bitmask operator~ (Bitmask x ) \
0038 { return static_cast<Bitmask>(~static_cast<boost::int_least32_t>(x)); } \
0039 \
0040 inline Bitmask & operator&=(Bitmask& x , Bitmask y) \
0041 { x = x & y ; return x ; } \
0042 \
0043 inline Bitmask & operator|=(Bitmask& x , Bitmask y) \
0044 { x = x | y ; return x ; } \
0045 \
0046 inline Bitmask & operator^=(Bitmask& x , Bitmask y) \
0047 { x = x ^ y ; return x ; } \
0048 \
0049 \
0050 \
0051 inline BOOST_CONSTEXPR bool operator!(Bitmask x) \
0052 { return !static_cast<int>(x); } \
0053 \
0054 inline BOOST_CONSTEXPR bool bitmask_set(Bitmask x) \
0055 { return !!x; }
0056
0057 #endif
0058