最終更新日時:
が更新

履歴 編集

function
<hive>

std::hive::block_capacity_limits(C++26)

constexpr hive_limits block_capacity_limits() const noexcept; // C++26

概要

要素ブロックの容量制限を取得する。

現在このhiveオブジェクトに設定されている、要素ブロックが保持できる要素数の下限・上限(hive_limits)を取得する。

戻り値

現在の容量制限を表すhive_limitsオブジェクト。

計算量

定数時間。

#include <hive>
#include <print>

int main()
{
  // 要素ブロックが保持できる要素数を、最小8・最大64に制限する
  std::hive<int> h{std::hive_limits{8, 64}};

  std::hive_limits limits = h.block_capacity_limits();
  std::println("min={}, max={}", limits.min, limits.max);
}

出力

min=8, max=64

バージョン

言語

  • C++26

処理系

関連項目

参照