Spec-Zone.ru › C++

Стандартная библиотека заголовок <cstddef>

Этот заголовок изначально находился в стандартной библиотеке C как <stddef.h>.

Этот заголовок является частью библиотеки %%%TRANSLATION_ERROR%%%.

Макросы

NULL
константа указателя на нуль, определяемая реализацией
(константа макроса)
offsetof
смещение в байтах от начала типа стандартного расположения до указанного члена
(макрос-функция)

Типы

size_t
целое беззнаковое число, возвращаемое оператором sizeof
(typedef)
ptrdiff_t
целое со знаком, возвращаемое при вычитании двух указателей
(typedef)
nullptr_t
(C++11)
тип литерала нулевого указателя nullptr
(typedef)
max_align_t
(C++11)
тривиальный тип с требованием выравнивания, не меньшим, чем у любого другого скалярного типа
(typedef)
byte
(C++17)
тип байта
(перечисление)

Функции

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

Примечания

  • NULL также определён в следующих заголовках:
    • <clocale>
    • <ctime>
    • <cstring>
    • <cstdio>
    • <cstdlib>
    • <cwchar>
  • std::size_t также определён в следующих заголовках:
    • <ctime>
    • <cstring>
    • <cstdio>
    • <cwchar>
    • <cuchar> (с C++17)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/header/cstddef

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API