GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • cpprefjp - C++日本語リファレンス
  • GitHub Project

This view

  • Original page
  • New address

GeezerVison is showing cpprefjp.github.io — UINTPTR_WIDTH - cpprefjp C++日本語リファレンス

  1. リファレンス
  2. cstdint
  3. UINTPTR_WIDTH

最終更新日時: 2026年08月31日 13時28分20秒 (JST)
Akira Takahashi が更新

履歴 編集

macro
<cstdint>

UINTPTR_WIDTH(C++26)

#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';
}

出力例

64

バージョン

言語

  • C++26

処理系

  • Clang: 23 ✅
  • GCC: 17 ✅
  • Visual C++: 2026 Update 2 ❌

参照

  • P3348R4 C++26 should refer to C23 not C17
    • C++26がC23を参照するようになり、このマクロが<cstdint>に追加された
  • P3248R5 Require [u]intptr_t
    • C++29で、uintptr_tが必ず定義されるようになったことにともない、このマクロも必ず定義されるようになった。C++26では、定義するかどうかは処理系定義だった
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.