标准库标头 <cstddef>

来自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)
 

此标头原作为 <stddef.h> 存在于 C 标准库。

此头文件是工具库的一部分。

实现定义的空指针常量
(宏常量)
从标准布局类型的起始到其指定成员的字节偏移量
(宏函数)

类型

sizeof 运算符返回的无符号整数类型
(typedef)
两个指针相减返回的有符号整数类型
(typedef)
(C++11)
空指针字面量 nullptr 的类型
(typedef)
具有不小于任何基础类型的内存对齐需求的平凡类型
(typedef)
(C++17)
字节类型
(枚举)

函数

转换 std::byte 为整数
(函数模板)

概要

namespace std {
  using ptrdiff_­t = /* 见描述 */;
  using size_­t = /* 见描述 */;
  using max_­align_­t = /* 见描述 */;
  using nullptr_­t = decltype(nullptr);
 
  enum class byte : unsigned char {};
 
  // 字节类型运算
  template<class IntType>
    constexpr byte& operator<<=(byte& b, IntType shift) noexcept;
  template<class IntType>
    constexpr byte operator<<(byte b, IntType shift) noexcept;
  template<class IntType>
    constexpr byte& operator>>=(byte& b, IntType shift) noexcept;
  template<class IntType>
    constexpr byte operator>>(byte b, IntType shift) noexcept;
  constexpr byte& operator|=(byte& l, byte r) noexcept;
  constexpr byte operator|(byte l, byte r) noexcept;
  constexpr byte& operator&=(byte& l, byte r) noexcept;
  constexpr byte operator&(byte l, byte r) noexcept;
  constexpr byte& operator^=(byte& l, byte r) noexcept;
  constexpr byte operator^(byte l, byte r) noexcept;
  constexpr byte operator~(byte b) noexcept;
  template<class IntType>
    constexpr IntType to_integer(byte b) noexcept;
}
 
#define NULL /* 见描述 */
#define offsetof(P, D) /* 见描述 */

注解