Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.33 KB

File metadata and controls

48 lines (35 loc) · 1.33 KB

UINT16_WIDTH

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

概要

uint16_t型の幅 (値ビット数) を表す(実装するかどうかは処理系定義)。#ifなどのプリプロセッサディレクティブで使用できる。

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

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

#include <cstdint>
#include <iostream>

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

出力例

16

バージョン

言語

  • C++26

処理系

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

参照