OpenTTD Source 20250205-master-gfd85ab1e2c
|
An overflow safe integer-like type. More...
#include "math_func.hpp"
Go to the source code of this file.
Data Structures | |
class | OverflowSafeInt< T > |
Overflow safe template for integers, i.e. More... | |
Typedefs | |
typedef OverflowSafeInt< int64_t > | OverflowSafeInt64 |
typedef OverflowSafeInt< int32_t > | OverflowSafeInt32 |
Functions | |
template<class T > | |
constexpr OverflowSafeInt< T > | operator+ (const int64_t a, const OverflowSafeInt< T > b) |
template<class T > | |
constexpr OverflowSafeInt< T > | operator- (const int64_t a, const OverflowSafeInt< T > b) |
template<class T > | |
constexpr OverflowSafeInt< T > | operator* (const int64_t a, const OverflowSafeInt< T > b) |
template<class T > | |
constexpr OverflowSafeInt< T > | operator/ (const int64_t a, const OverflowSafeInt< T > b) |
template<class T > | |
constexpr OverflowSafeInt< T > | operator+ (const int a, const OverflowSafeInt< T > b) |
template<class T > | |
constexpr OverflowSafeInt< T > | operator- (const int a, const OverflowSafeInt< T > b) |
template<class T > | |
constexpr OverflowSafeInt< T > | operator* (const int a, const OverflowSafeInt< T > b) |
template<class T > | |
constexpr OverflowSafeInt< T > | operator/ (const int a, const OverflowSafeInt< T > b) |
template<class T > | |
constexpr OverflowSafeInt< T > | operator+ (const uint a, const OverflowSafeInt< T > b) |
template<class T > | |
constexpr OverflowSafeInt< T > | operator- (const uint a, const OverflowSafeInt< T > b) |
template<class T > | |
constexpr OverflowSafeInt< T > | operator* (const uint a, const OverflowSafeInt< T > b) |
template<class T > | |
constexpr OverflowSafeInt< T > | operator/ (const uint a, const OverflowSafeInt< T > b) |
template<class T > | |
constexpr OverflowSafeInt< T > | operator+ (const uint8_t a, const OverflowSafeInt< T > b) |
template<class T > | |
constexpr OverflowSafeInt< T > | operator- (const uint8_t a, const OverflowSafeInt< T > b) |
template<class T > | |
constexpr OverflowSafeInt< T > | operator* (const uint8_t a, const OverflowSafeInt< T > b) |
template<class T > | |
constexpr OverflowSafeInt< T > | operator/ (const uint8_t a, const OverflowSafeInt< T > b) |
template<typename To , typename From > | |
constexpr To | ClampTo (OverflowSafeInt< From > value) |
An overflow safe integer-like type.
Definition in file overflowsafe_type.hpp.
typedef OverflowSafeInt<int32_t> OverflowSafeInt32 |
Definition at line 213 of file overflowsafe_type.hpp.
typedef OverflowSafeInt<int64_t> OverflowSafeInt64 |
Definition at line 212 of file overflowsafe_type.hpp.
|
constexpr |
Definition at line 223 of file overflowsafe_type.hpp.
|
inlineconstexpr |
Definition at line 197 of file overflowsafe_type.hpp.
|
inlineconstexpr |
Definition at line 191 of file overflowsafe_type.hpp.
|
inlineconstexpr |
Definition at line 203 of file overflowsafe_type.hpp.
|
inlineconstexpr |
Definition at line 209 of file overflowsafe_type.hpp.
|
inlineconstexpr |
Definition at line 195 of file overflowsafe_type.hpp.
|
inlineconstexpr |
Definition at line 189 of file overflowsafe_type.hpp.
|
inlineconstexpr |
Definition at line 201 of file overflowsafe_type.hpp.
|
inlineconstexpr |
Definition at line 207 of file overflowsafe_type.hpp.
|
inlineconstexpr |
Definition at line 196 of file overflowsafe_type.hpp.
|
inlineconstexpr |
Definition at line 190 of file overflowsafe_type.hpp.
|
inlineconstexpr |
Definition at line 202 of file overflowsafe_type.hpp.
|
inlineconstexpr |
Definition at line 208 of file overflowsafe_type.hpp.
|
inlineconstexpr |
Definition at line 198 of file overflowsafe_type.hpp.
|
inlineconstexpr |
Definition at line 192 of file overflowsafe_type.hpp.
|
inlineconstexpr |
Definition at line 204 of file overflowsafe_type.hpp.
|
inlineconstexpr |
Definition at line 210 of file overflowsafe_type.hpp.