gpt4 book ai didi

c++ - 与 std::size_t 类型

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:28:58 25 4
gpt4 key购买 nike

从我对 boost 的窥视中和 libstdc++ , 库通常使用 std::size_tstd::ssize_t每当事先不知道无符号/有符号索引的上限/下限时。我的问题是:为什么不使用 uintmax_t来自 <cstdint>而不是 std::size_tintmax_t而不是 std::ssize_t

最佳答案

前者是 C++ 标准的一部分,后者不是。更准确地说,cstdint header 是最近才引入的(在 C++11 中)。这是因为 stdint.h 本身是 C99 的一部分,比 C++98 更新。

关于c++ - <cstdint> 与 std::size_t 类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23660705/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com