最終更新日時:
が更新

履歴 編集

macro
<cstdint>

UINTPTR_MAX(C++11)

#define UINTPTR_MAX implementation-defined

概要

uintptr_t の最大値。

ビット数16をNとして、このマクロの値は2N - 1以上となる。

備考

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

#include <iostream>
#include <cstdint>

int main()
{
  std::uintptr_t max_value = UINTPTR_MAX;
  std::cout << static_cast<unsigned long long>(max_value) << std::endl;
}

出力例

18446744073709551615

バージョン

言語

  • C++11

処理系

参照