命名空间
变体
操作

标准库头文件 <cstddef>

来自 cppreference.cn
< cpp‎ | header
 
 
标准库头文件
算法
<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)   
数值
<cfenv> (C++11)
<cmath>
<complex>
<linalg> (C++26)
<numbers> (C++20)
<random> (C++11)
<simd> (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 标准库中为 <stddef.h>

此头文件是 utility 库的一部分。

目录

实现定义的空指针常量
(宏常量) [编辑]
标准布局 类型的起始位置到指定成员的字节偏移量
(函数宏) [编辑]

类型

sizeof 运算符返回的无符号整数类型
(类型定义) [编辑]
当减去两个指针时返回的有符号整数类型
(类型定义) [编辑]
(C++11)
空指针字面量 nullptr 的类型
(类型定义) [编辑]
对齐要求与任何其他标量类型一样大的平凡类型
(类型定义) [编辑]
(C++17)
字节类型
(枚举) [编辑]

函数

std::byte 转换为整数
(函数模板) [编辑]

[编辑] 概要

namespace std {
  using ptrdiff_t = /* see description */;
  using size_t = /* see description */;
  using max_align_t = /* see description */;
  using nullptr_t = decltype(nullptr);
 
  enum class byte : unsigned char {};
 
  // byte type operations
  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 /* see description */
#define offsetof(P, D) /* see description */

[编辑] 注释