Namespaces
Variants
Views
Actions

Standard library header <stdckdint.h> (C++26)

From cppreference.com
< cpp‎ | header
 
 
Standard library headers
Algorithms
<algorithm>
<numeric>
Strings
<cctype>
<cstring>
<cuchar> (C++11)
<cwchar>
<cwctype>
<string_view> (C++17)
<string>
Text processing
<clocale>
<codecvt> (C++11/17/26*)
<locale>
<regex> (C++11)
<text_encoding> (C++26)   
Numerics
<cfenv> (C++11)
<cmath>
<complex>
<linalg> (C++26)
<numbers> (C++20)
<random> (C++11)
<simd> (C++26)
<stdckdint.h> (C++26)
<valarray>
Time
<chrono> (C++11)
<ctime>
C compatibility
<ccomplex> (C++11/17/20*)
<ciso646> (until C++20)
<cstdalign> (C++11/17/20*)
<cstdbool> (C++11/17/20*)
<ctgmath> (C++11/17/20*)
 

This header was originally in the C standard library (<stdckdint.h>).

This header is part of the numeric library, in particular, it provides several function templates for checked integer arithmetic.

It is unspecified whether <stdckdint.h> provides any declarations in namespace std.

Functions

(C++26)
checked addition operation on two integers
(function template) [edit]
(C++26)
checked subtraction operation on two integers
(function template) [edit]
(C++26)
checked multiplication operation on two integers
(function template) [edit]

[edit] Synopsis

#define __STDC_VERSION_STDCKDINT_H__ 202311L
 
template<class type1, class type2, class type3>
bool ckd_add(type1* result, type2 a, type3 b);
 
template<class type1, class type2, class type3>
bool ckd_sub(type1* result, type2 a, type3 b);
 
template<class type1, class type2, class type3>
bool ckd_mul(type1* result, type2 a, type3 b);