Skip to content

Latest commit

 

History

History
56 lines (41 loc) · 1.88 KB

File metadata and controls

56 lines (41 loc) · 1.88 KB

UINTPTR_WIDTH

  • cstdint[meta header]
  • macro[meta id-type]
  • cpp26[meta cpp]
#define UINTPTR_WIDTH implementation-defined

概要

uintptr_t型の幅 (値ビット数) を表す。#ifなどのプリプロセッサディレクティブで使用できる。

幅 (width) とは、その型が値の表現に使用するビット数であり、符号付き整数型では符号ビットを含む。パディングビットを含むストレージサイズ (sizeof × CHAR_BIT) とは異なる場合がある。

C23で<stdint.h>に追加されたマクロであり、C++26で<cstdint>に取り込まれた。

備考

  • このマクロの定義有無
    • C++26 : このマクロを定義するかどうかは処理系定義である (uintptr_tが定義される場合にのみ定義される)
    • C++29 : このマクロは必ず定義される

#include <cstdint>
#include <iostream>

int main()
{
  std::cout << UINTPTR_WIDTH << '\n';
}
  • UINTPTR_WIDTH[color ff0000]

出力例

64

バージョン

言語

  • C++26

処理系

  • Clang: 23 [mark verified]
  • GCC: 17 [mark verified]
  • Visual C++: 2026 Update 2 [mark noimpl]

参照