LibreOffice Module o3tl (master) 1
|
Wrap up an integer type so that we prevent accidental conversion to other integer types. More...
#include <strong_int.hxx>
Public Member Functions | |
template<typename T > | |
constexpr | strong_int (T value, typename std::enable_if< std::is_integral< T >::value, int >::type=0) |
strong_int () | |
constexpr | operator UNDERLYING_TYPE () const |
operator bool () const | |
UNDERLYING_TYPE | get () const |
bool | operator< (strong_int const &other) const |
bool | operator<= (strong_int const &other) const |
bool | operator> (strong_int const &other) const |
bool | operator>= (strong_int const &other) const |
bool | operator== (strong_int const &other) const |
bool | operator!= (strong_int const &other) const |
strong_int & | operator++ () |
strong_int | operator++ (int) |
strong_int & | operator-- () |
strong_int | operator-- (int) |
strong_int & | operator+= (strong_int const &other) |
strong_int & | operator-= (strong_int const &other) |
strong_int & | operator%= (strong_int const &other) |
strong_int & | operator*= (strong_int const &other) |
strong_int & | operator/= (strong_int const &other) |
strong_int | operator% (strong_int const &other) const |
strong_int | operator- () const |
strong_int | operator* (strong_int const &other) const |
strong_int | operator/ (strong_int const &other) const |
bool | anyOf (strong_int v) const |
template<typename... Args> | |
bool | anyOf (strong_int first, Args... args) const |
Private Attributes | |
UNDERLYING_TYPE | m_value |
Wrap up an integer type so that we prevent accidental conversion to other integer types.
e.g. typedef o3tl::strong_int<unsigned, struct MyIntTag> MyInt;
UNDERLYING_TYPE | the underlying scalar type |
PHANTOM_TYPE | a type tag, used to distinguish this instantiation of the template from other instantiations with the same UNDERLYING_TYPE. |
Definition at line 83 of file strong_int.hxx.
|
inlineexplicitconstexpr |
Definition at line 86 of file strong_int.hxx.
References value.
|
inline |
Definition at line 97 of file strong_int.hxx.
Referenced by o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator%(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator*(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator++(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator-(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator--(), and o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator/().
|
inline |
Definition at line 132 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::anyOf(), args, and first.
|
inline |
Definition at line 127 of file strong_int.hxx.
References v.
Referenced by o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::anyOf().
|
inline |
Definition at line 101 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value.
Referenced by o3tl::operator+(), and o3tl::operator-().
|
inlineexplicit |
Definition at line 100 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value.
|
inlineexplicitconstexpr |
Definition at line 99 of file strong_int.hxx.
|
inline |
Definition at line 108 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value.
|
inline |
Definition at line 119 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value, and o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::strong_int().
|
inline |
Definition at line 115 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value.
|
inline |
Definition at line 123 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value, and o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::strong_int().
|
inline |
Definition at line 116 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value.
|
inline |
Definition at line 109 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value.
|
inline |
Definition at line 110 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value, and o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::strong_int().
|
inline |
Definition at line 113 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value.
|
inline |
Definition at line 121 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value, and o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::strong_int().
|
inline |
Definition at line 111 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value.
|
inline |
Definition at line 112 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value, and o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::strong_int().
|
inline |
Definition at line 114 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value.
|
inline |
Definition at line 125 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value, and o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::strong_int().
|
inline |
Definition at line 117 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value.
|
inline |
Definition at line 103 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value.
|
inline |
Definition at line 104 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value.
|
inline |
Definition at line 107 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value.
|
inline |
Definition at line 105 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value.
|
inline |
Definition at line 106 of file strong_int.hxx.
References o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::m_value.
|
private |
Definition at line 137 of file strong_int.hxx.
Referenced by o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::get(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator bool(), o3tl::strong_int< sal_Int16, struct SdrLayerIDTag >::operator sal_Int16(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator!=(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator%(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator%=(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator*(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator*=(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator++(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator+=(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator-(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator--(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator-=(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator/(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator/=(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator<(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator<=(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator==(), o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator>(), and o3tl::strong_int< UNDERLYING_TYPE, PHANTOM_TYPE >::operator>=().