标准库标头 <stdckdint.h> (C++26)

来自cppreference.com
< cpp‎ | header


 
 
标准库头
通用工具
<any> (C++17)
<bitset>
<bit> (C++20)
<charconv> (C++17)
<expected> (C++23)
<format> (C++20)
<functional>
<optional> (C++17)
<stdbit.h> (C++26)
<tuple> (C++11)
<typeindex> (C++11)
<utility>
<variant> (C++17)
容器
<array> (C++11)
<deque>
<flat_map> (C++23)
<flat_set> (C++23)
<forward_list> (C++11)
<hive> (C++26)
<inplace_vector> (C++26)   
<list>
<map>
<mdspan> (C++23)
<queue>
<set>
<span> (C++20)
<stack>
<unordered_map> (C++11)
<unordered_set> (C++11)
<vector>
迭代器
<iterator>
范围
<generator> (C++23)
<ranges> (C++20)
算法
<algorithm>
<numeric>
字符串
<cctype>
<cstring>
<cuchar> (C++11)
<cwchar>
<cwctype>
<string_view> (C++17)
<string>
文本处理
<clocale>
<codecvt> (C++11/17/26*)
<locale>
<regex> (C++11)
<text_encoding> (C++26)   
cpp/header#数值库数值
<cfenv> (C++11)
<cmath>
<complex>
<linalg> (C++26)
<numbers> (C++20)
<random> (C++11)
<simd> (C++26)
<stdckdint.h> (C++26)
<valarray>
时间
<chrono> (C++11)
<ctime>
C 兼容性
<ccomplex> (C++11/17/20*)
<ciso646> (C++20 前)
<cstdalign> (C++11/17/20*)
<cstdbool> (C++11/17/20*)
<ctgmath> (C++11/17/20*)
 

此标头原本在 C 标准库中(<stdckdint.h>)。

此标头是数值库的一部分,特别是,它提供了几个带检查算术的函数模板。

未指定 <stdckdint.h> 是否提供命名空间 std 中的任何声明。

函数

(C++26)
两个整数的带检查加法运算
(函数模板) [编辑]
(C++26)
两个整数的带检查减法运算
(函数模板) [编辑]
(C++26)
两个整数的带检查乘法运算
(函数模板) [编辑]

[编辑] 概要

#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);