![]() |
C++ Library Extensions 2022.12.09
To help learn modern C++ programming
|
Go to the source code of this file.
Functions | |
void | display_integral_types () |
template<typename Type > | |
types::enable_if_signed_integral_t< Type > | safe_add (Type a, Type b) |
template<typename Type > | |
types::enable_if_signed_integral_t< Type > | safe_sub (Type a, Type b) |
template<typename Type > | |
types::enable_if_unsigned_integral_t< Type > | safe_add (Type a, Type b) |
template<typename Type > | |
types::enable_if_unsigned_integral_t< Type > | safe_sub (Type a, Type b) |
template<typename Type > | |
types::enable_if_integral_t< Type > | safe_mul (Type a, Type b) |
template<typename Type > | |
types::enable_if_integral_t< Type > | safe_div (Type a, Type b) |
void | examples_for_safe_arithmetic () |
int | main () |
Variables | |
tpf::sstream | stream |
auto | nl = tpf::nl |
auto | endl = tpf::endl |
void display_integral_types | ( | ) |
void examples_for_safe_arithmetic | ( | ) |
Definition at line 214 of file 007-integer.cpp.
int main | ( | ) |
types::enable_if_signed_integral_t< Type > safe_add | ( | Type | a, |
Type | b | ||
) |
types::enable_if_unsigned_integral_t< Type > safe_add | ( | Type | a, |
Type | b | ||
) |
Definition at line 113 of file 007-integer.cpp.
types::enable_if_integral_t< Type > safe_div | ( | Type | a, |
Type | b | ||
) |
types::enable_if_integral_t< Type > safe_mul | ( | Type | a, |
Type | b | ||
) |
types::enable_if_signed_integral_t< Type > safe_sub | ( | Type | a, |
Type | b | ||
) |
types::enable_if_unsigned_integral_t< Type > safe_sub | ( | Type | a, |
Type | b | ||
) |
Definition at line 143 of file 007-integer.cpp.
auto endl = tpf::endl |
Definition at line 7 of file 007-integer.cpp.
auto nl = tpf::nl |
Definition at line 6 of file 007-integer.cpp.
tpf::sstream stream |
Definition at line 5 of file 007-integer.cpp.