17 #ifndef HH_SENF_Utils_RestrictedInt_ 18 #define HH_SENF_Utils_RestrictedInt_ 1 21 #include <boost/operators.hpp> 33 template <
class Base,
class Tag>
35 :
public boost::ordered_euclidian_ring_operators< RestrictedInt<Base,Tag>,
36 boost::unit_steppable< RestrictedInt<Base,Tag>,
37 boost::shiftable< RestrictedInt<Base,Tag>,
38 boost::bitwise1< RestrictedInt<Base,Tag>,
39 senf::comparable_safe_bool<RestrictedInt<Base,Tag> > > > > >
48 # define BinaryOp(op) \ 49 RestrictedInt & operator op ## = (RestrictedInt other) \ 50 { value_ op ## = other.value_; return *this; } 51 # define IncDecOp(op) \ 52 RestrictedInt & operator op () \ 53 { op value_; return *this; } 54 # define PrefixOp(op) \ 55 RestrictedInt const operator op () const \ 56 { return RestrictedInt(op value_); } 57 # define CompareOp(op) \ 58 bool operator op (RestrictedInt other) const \ 59 { return value_ op other.value_; } 89 bool boolean_test()
const 97 template <
class Base,
class Tag,
typename OtherType>
103 template <
class Base,
class Tag,
typename OtherType>
109 template <
class Base,
class Tag,
typename OtherType>
115 template <
class Base,
class Tag,
typename OtherType>
121 template <
class Base,
class Tag>
122 std::ostream & operator<<(std::ostream & os, RestrictedInt<Base, Tag> value)
128 template <
class Base,
class Tag>
RestrictedInt< Base, Tag > operator*(OtherType a, RestrictedInt< Base, Tag > b)
RestrictedInt(Base value)
RestrictedInt< Base, Tag > operator/(OtherType a, RestrictedInt< Base, Tag > b)
BinaryOp(+) BinaryOp(-) BinaryOp(*) BinaryOp(/) BinaryOp(%) BinaryOp(>>) BinaryOp(<<) BinaryOp(&) BinaryOp(|) BinaryOp(^) IncDecOp(++) IncDecOp(--) PrefixOp(~) PrefixOp(-) CompareOp(<) CompareOp(
std::istream & operator>>(std::istream &is, RestrictedInt< Base, Tag > &value)