<cstddef>
包含 C 標準程式庫標頭 < stddef.h > ,並將相關聯的名稱新增至 std
命名空間。 包含此標頭可確保在命名空間中 std
宣告使用外部連結宣告的名稱。
注意
<cstddef > 包含類型 位元組 ,且不包含 類型 wchar_t
。
語法
#include <cstddef>
命名空間和宏
namespace std {
using ptrdiff_t = see definition;
using size_t = see definition;
using max_align_t = see definition;
using nullptr_t = decltype(nullptr);
}
#define NULL // an implementation-defined null pointer constant
#define offsetof(type, member-designator)
參數
ptrdiff_t
實作定義的帶正負號整數類型,可以保存陣列物件中兩個注標的差異。
size_t
實作定義的不帶正負號的整數類型,足以包含任何物件位元組的大小。
max_align_t
POD 類型,其對齊需求至少與每個純量類型一樣大,而且每個內容都支援其對齊需求。
nullptr_t
運算式類型的同義字 nullptr
。 nullptr
雖然無法擷取位址,但是可以取得另一個 nullptr_t 物件位址,也就是左值。
byte 類別
enum class byte : unsigned char {};
template <class IntType>
constexpr byte& operator<<=(byte& b, IntType shift) noexcept;
constexpr byte operator<<(byte b, IntType shift) noexcept;
constexpr byte& operator>>=(byte& b, IntType shift) noexcept;
constexpr byte operator>>(byte b, IntType shift) noexcept;
constexpr byte& operator|=(byte& left, byte right) noexcept;
constexpr byte operator|(byte left, byte right) noexcept;
constexpr byte& operator&=(byte& left, byte right) noexcept;
constexpr byte operator&(byte left, byte right) noexcept;
constexpr byte& operator^=(byte& left, byte right) noexcept;
constexpr byte operator^(byte left, byte right) noexcept;
constexpr byte operator~(byte b) noexcept;
template <class IntType>
IntType to_integer(byte b) noexcept;
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應