Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 819 Bytes

File metadata and controls

59 lines (43 loc) · 819 Bytes

front

  • string_view[meta header]
  • std[meta namespace]
  • basic_string_view[meta class]
  • function[meta id-type]
  • cpp17[meta cpp]
constexpr const_reference front() const;

概要

先頭文字を取得する。

要件

戻り値

return data()[0];
  • data()[link data.md]

例外

投げない

#include <cassert>
#include <string_view>

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

  char c = sv.front();
  assert(c == 'H');
}
  • front()[color ff0000]

出力

バージョン

言語

  • C++17

処理系