1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #ifndef BOOST_BITMASK_HPP
- #define BOOST_BITMASK_HPP
- #include <boost/cstdint.hpp>
- #define BOOST_BITMASK(Bitmask) \
- \
- inline Bitmask operator| (Bitmask x , Bitmask y ) \
- { return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
- | static_cast<boost::int_least32_t>(y)); } \
- \
- inline Bitmask operator& (Bitmask x , Bitmask y ) \
- { return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
- & static_cast<boost::int_least32_t>(y)); } \
- \
- inline Bitmask operator^ (Bitmask x , Bitmask y ) \
- { return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
- ^ static_cast<boost::int_least32_t>(y)); } \
- \
- inline Bitmask operator~ (Bitmask x ) \
- { return static_cast<Bitmask>(~static_cast<boost::int_least32_t>(x)); } \
- \
- inline Bitmask & operator&=(Bitmask & x , Bitmask y) \
- { x = x & y ; return x ; } \
- \
- inline Bitmask & operator|=(Bitmask & x , Bitmask y) \
- { x = x | y ; return x ; } \
- \
- inline Bitmask & operator^=(Bitmask & x , Bitmask y) \
- { x = x ^ y ; return x ; }
- #endif
|