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

履歴 編集

function
<ranges>

std::ranges::basic_istream_view::end(C++20)

constexpr default_sentinel_t end() const noexcept; // (1) C++20

概要

番兵を取得する。

戻り値

以下と等価:

#include <ranges>
#include <sstream>
#include <iostream>

int main() {
  auto iss = std::istringstream{"1 2 3 4 5"};
  auto r = std::views::istream<int>(iss);
  auto it = r.begin();
  auto last = r.end();

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

出力

1 2 3 4 5 

バージョン

言語

  • C++20

処理系