GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • cpprefjp - C++日本語リファレンス
  • GitHub Project

This view

  • Original page
  • New address

GeezerVison is showing cpprefjp.github.io — std::basic_stringstream::view - cpprefjp C++日本語リファレンス

  1. リファレンス
  2. sstream
  3. basic_stringstream
  4. view

最終更新日時: 2025年07月10日 10時26分30秒 (JST)
Koichi Murase が更新

履歴 編集

function
<sstream>

std::basic_stringstream::view(C++20)

basic_string_view<CharT, Traits> view() const noexcept;

概要

文字列ビューオブジェクトの取得を行う。

戻り値

rdbuf()->view()

例

#include <iostream>
#include <sstream>
#include <string_view>

int main()
{
  std::stringstream ss("Hello World");

  std::string_view sv = ss.view();

  std::cout << sv.substr(0, 5) << std::endl;  // "Hello"
}

出力

Hello

バージョン

言語

  • C++20

処理系

  • Clang: 12 ✅
  • GCC: 12 ✅
  • Visual C++: 2019 Update 10 ✅

参照

  • P0408R7 Efficient Access to basic_stringbuf's Buffer
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.