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

履歴 編集

function
<string_view>

std::basic_string_view::end(C++17)

constexpr const_iterator end() const noexcept;

概要

末尾の次を指すイテレータを取得する。

戻り値

return begin() + size();

#include <iostream>
#include <string_view>
#include <algorithm>

int main()
{
  std::string_view sv = "Hello";

  std::for_each(sv.begin(), sv.end(), [](char c) {
    std::cout << c << std::endl;
  });
}

出力

H
e
l
l
o

バージョン

言語

  • C++17

処理系