Skip to content

Latest commit

 

History

History
64 lines (47 loc) · 1.38 KB

File metadata and controls

64 lines (47 loc) · 1.38 KB

is_exhaustive

  • mdspan[meta header]
  • function[meta id-type]
  • std[meta namespace]
  • layout_stride::mapping[meta class]
  • cpp23[meta cpp]
constexpr bool is_exhaustive() const noexcept;

概要

レイアウトマッピングのExhaustive特性を取得する。

戻り値

  • rank_ == 0のとき、trueを返す。
  • そうでなければ、取りうる全ての多次元インデクス値に対応する要素位置を考えたとき、アクセスされうる要素位置に隙間が生じないならばtrueを返す。
  • そうでなければ、falseを返す。

例外

投げない

#include <cassert>
#include <array>
#include <mdspan>

int main()
{
  using Ext2x3 = std::extents<size_t, 2, 3>;
  using Mapping = std::layout_stride::mapping<Ext2x3>;

  Mapping map1{{}, std::array{3, 1}};
  assert(map1.is_exhaustive());

  Mapping map2{{}, std::array{4, 1}};
  assert(not map2.is_exhaustive());
}
  • is_exhaustive()[color ff0000]
  • std::layout_stride::mapping[link ../mapping.md]

出力

バージョン

言語

  • C++23

処理系

参照