#include <overflowsafe_type.hpp>
Public Member Functions | |
OverflowSafeInt (const OverflowSafeInt &other) | |
OverflowSafeInt (const int64 int_) | |
FORCEINLINE OverflowSafeInt & | operator= (const OverflowSafeInt &other) |
FORCEINLINE OverflowSafeInt | operator- () const |
FORCEINLINE OverflowSafeInt & | operator+= (const OverflowSafeInt &other) |
Safe implementation of addition. | |
FORCEINLINE OverflowSafeInt | operator+ (const OverflowSafeInt &other) const |
FORCEINLINE OverflowSafeInt | operator+ (const int other) const |
FORCEINLINE OverflowSafeInt | operator+ (const uint other) const |
FORCEINLINE OverflowSafeInt & | operator-= (const OverflowSafeInt &other) |
FORCEINLINE OverflowSafeInt | operator- (const OverflowSafeInt &other) const |
FORCEINLINE OverflowSafeInt | operator- (const int other) const |
FORCEINLINE OverflowSafeInt | operator- (const uint other) const |
FORCEINLINE OverflowSafeInt & | operator++ () |
FORCEINLINE OverflowSafeInt & | operator-- () |
FORCEINLINE OverflowSafeInt | operator++ (int) |
FORCEINLINE OverflowSafeInt | operator-- (int) |
FORCEINLINE OverflowSafeInt & | operator*= (const int factor) |
Safe implementation of multiplication. | |
FORCEINLINE OverflowSafeInt | operator* (const int64 factor) const |
FORCEINLINE OverflowSafeInt | operator* (const int factor) const |
FORCEINLINE OverflowSafeInt | operator* (const uint factor) const |
FORCEINLINE OverflowSafeInt | operator* (const uint16 factor) const |
FORCEINLINE OverflowSafeInt | operator* (const byte factor) const |
FORCEINLINE OverflowSafeInt & | operator/= (const int divisor) |
FORCEINLINE OverflowSafeInt | operator/ (const OverflowSafeInt &divisor) const |
FORCEINLINE OverflowSafeInt | operator/ (const int divisor) const |
FORCEINLINE OverflowSafeInt | operator/ (const uint divisor) const |
FORCEINLINE OverflowSafeInt & | operator%= (const int divisor) |
FORCEINLINE OverflowSafeInt | operator% (const int divisor) const |
FORCEINLINE OverflowSafeInt & | operator<<= (const int shift) |
FORCEINLINE OverflowSafeInt | operator<< (const int shift) const |
FORCEINLINE OverflowSafeInt & | operator>>= (const int shift) |
FORCEINLINE OverflowSafeInt | operator>> (const int shift) const |
FORCEINLINE bool | operator== (const OverflowSafeInt &other) const |
FORCEINLINE bool | operator!= (const OverflowSafeInt &other) const |
FORCEINLINE bool | operator> (const OverflowSafeInt &other) const |
FORCEINLINE bool | operator>= (const OverflowSafeInt &other) const |
FORCEINLINE bool | operator< (const OverflowSafeInt &other) const |
FORCEINLINE bool | operator<= (const OverflowSafeInt &other) const |
FORCEINLINE bool | operator== (const int other) const |
FORCEINLINE bool | operator!= (const int other) const |
FORCEINLINE bool | operator> (const int other) const |
FORCEINLINE bool | operator>= (const int other) const |
FORCEINLINE bool | operator< (const int other) const |
FORCEINLINE bool | operator<= (const int other) const |
FORCEINLINE | operator int64 () const |
Private Attributes | |
T | m_value |
The non-overflow safe backend to store the value in. |
integers that will never overflow you multiply the maximum value with 2, or add 2, or substract somethng from the minimum value, etc.
T | the type these integers are stored with. | |
T_MAX | the maximum value for the integers. | |
T_MIN | the minimum value for the integers. |
Definition at line 19 of file overflowsafe_type.hpp.
FORCEINLINE OverflowSafeInt& OverflowSafeInt< T, T_MAX, T_MIN >::operator+= | ( | const OverflowSafeInt< T, T_MAX, T_MIN > & | other | ) | [inline] |
Safe implementation of addition.
other | the amount to add |
Definition at line 40 of file overflowsafe_type.hpp.
FORCEINLINE OverflowSafeInt& OverflowSafeInt< T, T_MAX, T_MIN >::operator*= | ( | const int | factor | ) | [inline] |
Safe implementation of multiplication.
factor | the factor to multiply this with. |
Definition at line 71 of file overflowsafe_type.hpp.
T OverflowSafeInt< T, T_MAX, T_MIN >::m_value [private] |
The non-overflow safe backend to store the value in.
Definition at line 23 of file overflowsafe_type.hpp.
Referenced by OverflowSafeInt< signed __int64, INT64_MAX, INT64_MIN >::operator*=(), and OverflowSafeInt< signed __int64, INT64_MAX, INT64_MIN >::operator+=().