12 #ifndef ZYPP_BASE_DEFAULTINTEGRAL_H
13 #define ZYPP_BASE_DEFAULTINTEGRAL_H
16 #include <boost/static_assert.hpp>
17 #include <boost/type_traits/is_integral.hpp>
40 template<
class _Tp, _Tp _Initial>
49 { BOOST_STATIC_ASSERT(boost::is_integral<_Tp>::value); }
53 _Tp &
get() {
return _val; }
54 _Tp
get()
const {
return _val; }
56 operator _Tp &() {
return get(); }
57 operator _Tp ()
const {
return get(); }
87 #endif // ZYPP_BASE_DEFAULTINTEGRAL_H
DefaultIntegral(_Tp val_r=_Initial)
DefaultIntegral & operator+=(_Tp rhs)
DefaultIntegral & operator-=(_Tp rhs)
DefaultIntegral operator--(int)
DefaultIntegral operator++(int)
DefaultIntegral & operator*=(_Tp rhs)
Integral type with defined initial value when default constructed.
DefaultIntegral & operator=(_Tp rhs)
DefaultIntegral & operator/=(_Tp rhs)
DefaultIntegral & operator--()
DefaultIntegral & reset()
Reset to the defined initial value.
DefaultIntegral & operator++()