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

履歴 編集

function
<string_view>

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

constexpr const_iterator cend() const noexcept;

概要

末尾の次を指す読み取り専用イテレータを取得する。

戻り値

return cbegin() + size();

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

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

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

出力

H
e
l
l
o

バージョン

言語

  • C++17

処理系