首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

cstddef

This header was originally in the C standard library as <stddef.h>.

This header is part of the utility library.

Macros

NULL

implementation-defined null pointer constant (macro constant)

offsetof

byte offset from the beginning of a standard-layout type to specified member (function macro)

Types

size_t

unsigned integer type returned by the sizeof operator (typedef)

ptrdiff_t

signed integer type returned when subtracting two pointers (typedef)

nullptr_t (C++11)

the type of the null pointer literal nullptr (typedef)

max_align_t (C++11)

POD type with alignment requirement as great as any other scalar type (typedef)

byte (C++17)

the byte type (enum)

Synopsis

代码语言:javascript
复制
namespace std {
    using ptrdiff_t = /*see definition*/ ;
    using size_t = /*see definition*/ ;
    using max_align_t = /*see definition*/ ;
    using nullptr_t = decltype(nullptr);
 
    enum class byte : unsigned char {} ;
    template <class IntegerType>
    constexpr byte& operator<<=(byte& b, IntegerType shift) noexcept;
    template <class IntegerType>
    constexpr byte operator<<(byte b, IntegerType shift) noexcept;
    template <class IntegerType>
    constexpr byte& operator>>=(byte& b, IntegerType shift) noexcept;
    template <class IntegerType>
    constexpr byte operator>>(byte b, IntegerType 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 IntegerType>
    constexpr IntegerType to_integer(byte b) noexcept; 
}
#define NULL /*see definition*/
#define offsetof(P, D) /*see definition*/

Notes

  • NULL is also defined in the following headers:
    • <clocale>
    • <ctime>
    • <cstring>
    • <cstdio>
    • <cwchar>
  • std::size_t is also defined in the following headers:
    • <ctime>
    • <cstring>
    • <cstdio>
    • <cwchar>
代码语言:txt
复制
 ? cppreference.com

Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com