OpenTTD
Data Structures | Typedefs | Functions
overflowsafe_type.hpp File Reference

An overflow safe integer-like type. More...

#include "math_func.hpp"

Go to the source code of this file.

Data Structures

class  OverflowSafeInt< T, T_MAX, T_MIN >
 Overflow safe template for integers, i.e. More...
 

Typedefs

typedef OverflowSafeInt< int64, INT64_MAX, INT64_MIN > OverflowSafeInt64
 
typedef OverflowSafeInt< int32, INT32_MAX, INT32_MIN > OverflowSafeInt32
 

Functions

template<class T , int64 T_MAX, int64 T_MIN>
OverflowSafeInt< T, T_MAX, T_MIN > operator+ (int64 a, OverflowSafeInt< T, T_MAX, T_MIN > b)
 
template<class T , int64 T_MAX, int64 T_MIN>
OverflowSafeInt< T, T_MAX, T_MIN > operator- (int64 a, OverflowSafeInt< T, T_MAX, T_MIN > b)
 
template<class T , int64 T_MAX, int64 T_MIN>
OverflowSafeInt< T, T_MAX, T_MIN > operator* (int64 a, OverflowSafeInt< T, T_MAX, T_MIN > b)
 
template<class T , int64 T_MAX, int64 T_MIN>
OverflowSafeInt< T, T_MAX, T_MIN > operator/ (int64 a, OverflowSafeInt< T, T_MAX, T_MIN > b)
 
template<class T , int64 T_MAX, int64 T_MIN>
OverflowSafeInt< T, T_MAX, T_MIN > operator+ (int a, OverflowSafeInt< T, T_MAX, T_MIN > b)
 
template<class T , int64 T_MAX, int64 T_MIN>
OverflowSafeInt< T, T_MAX, T_MIN > operator- (int a, OverflowSafeInt< T, T_MAX, T_MIN > b)
 
template<class T , int64 T_MAX, int64 T_MIN>
OverflowSafeInt< T, T_MAX, T_MIN > operator* (int a, OverflowSafeInt< T, T_MAX, T_MIN > b)
 
template<class T , int64 T_MAX, int64 T_MIN>
OverflowSafeInt< T, T_MAX, T_MIN > operator/ (int a, OverflowSafeInt< T, T_MAX, T_MIN > b)
 
template<class T , int64 T_MAX, int64 T_MIN>
OverflowSafeInt< T, T_MAX, T_MIN > operator+ (uint a, OverflowSafeInt< T, T_MAX, T_MIN > b)
 
template<class T , int64 T_MAX, int64 T_MIN>
OverflowSafeInt< T, T_MAX, T_MIN > operator- (uint a, OverflowSafeInt< T, T_MAX, T_MIN > b)
 
template<class T , int64 T_MAX, int64 T_MIN>
OverflowSafeInt< T, T_MAX, T_MIN > operator* (uint a, OverflowSafeInt< T, T_MAX, T_MIN > b)
 
template<class T , int64 T_MAX, int64 T_MIN>
OverflowSafeInt< T, T_MAX, T_MIN > operator/ (uint a, OverflowSafeInt< T, T_MAX, T_MIN > b)
 
template<class T , int64 T_MAX, int64 T_MIN>
OverflowSafeInt< T, T_MAX, T_MIN > operator+ (byte a, OverflowSafeInt< T, T_MAX, T_MIN > b)
 
template<class T , int64 T_MAX, int64 T_MIN>
OverflowSafeInt< T, T_MAX, T_MIN > operator- (byte a, OverflowSafeInt< T, T_MAX, T_MIN > b)
 
template<class T , int64 T_MAX, int64 T_MIN>
OverflowSafeInt< T, T_MAX, T_MIN > operator* (byte a, OverflowSafeInt< T, T_MAX, T_MIN > b)
 
template<class T , int64 T_MAX, int64 T_MIN>
OverflowSafeInt< T, T_MAX, T_MIN > operator/ (byte a, OverflowSafeInt< T, T_MAX, T_MIN > b)
 

Detailed Description

An overflow safe integer-like type.

Definition in file overflowsafe_type.hpp.