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

履歴 編集

function
<ranges>

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

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

概要

番兵を取得する。

戻り値

以下と等価:

return iterator(addressof(*value_), bound_);

#include <ranges>
#include <iostream>

int main() {
  auto r = std::views::repeat(42, 3);
  auto it = r.begin();
  auto last = r.end();

  for (; it != last; ++it) {
    std::cout << *it << ' ';
  }
}

出力

42 42 42 

バージョン

言語

  • C++23

処理系