##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# Standard library header <cstddef>

From cppreference.com
< cpp‎ | header

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

This header is part of the utility library.

### [edit] Macros

NULL | implementation-defined null pointer constant (macro constant) [edit]
offsetof | byte offset from the beginning of a standard-layout type to specified member (function macro) [edit]

### [edit] Types

size_t | unsigned integer type returned by the `sizeof` operator (typedef) [edit]
ptrdiff_t | signed integer type returned when subtracting two pointers (typedef) [edit]
nullptr_t (C++11) | the type of the null pointer literal `nullptr` (typedef) [edit]
max_align_t (C++11) | POD type with alignment requirement as great as any other scalar type (typedef) [edit]
byte (C++17) | the byte type (enum) [edit]

### [edit] Synopsis

    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*/

### [edit] 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>`

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/header/cstddef&oldid=91071"