最終更新日時(UTC):
が更新

履歴 編集

function
<ranges>

std::ranges::repeat_view::size(C++23)

constexpr auto size() const
  requires (!same_as<Bound, unreachable_sentinel_t>); // (1) C++23

概要

要素数を取得する。

戻り値

以下と等価:

return to-unsigned-like(bound_);

#include <ranges>
#include <iostream>

int main() {
  auto r = std::views::repeat(42, 3);
  std::cout << r.size() << std::endl;
}

出力

3

バージョン

言語

  • C++23

処理系