标准库标头 <cstddef>
来自cppreference.com
此标头原作为 <stddef.h> 存在于 C 标准库。
此头文件是工具库的一部分。
宏 | ||
实现定义的空指针常量 (宏常量) | ||
从标准布局类型的起始到其指定成员的字节偏移量 (宏函数) | ||
类型 | ||
sizeof 运算符返回的无符号整数类型 (typedef) | ||
两个指针相减返回的有符号整数类型 (typedef) | ||
(C++11) | 空指针字面量 nullptr 的类型 (typedef) | |
(C++11) | 具有不小于任何基础类型的内存对齐需求的平凡类型 (typedef) | |
(C++17) | 字节类型 (枚举) | |
函数 | ||
(C++17) | 转换 std::byte 为整数 (函数模板) |
[编辑]概要
namespace std {using ptrdiff_t =/* 见描述 */;using size_t =/* 见描述 */;using max_align_t =/* 见描述 */;using nullptr_t = decltype(nullptr); enumclass byte :unsignedchar{}; // 字节类型运算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) /* 见描述 */