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_ispanstream::rdbuf - cpprefjp C++日本語リファレンス

  1. リファレンス
  2. spanstream
  3. basic_ispanstream
  4. rdbuf

最終更新日時: 2025年08月11日 15時35分16秒 (JST)
suomesta が更新

履歴 編集

function
<spanstream>

std::basic_ispanstream::rdbuf(C++23)

basic_spanbuf<charT, traits>* rdbuf() const noexcept;

概要

固定長ストリームバッファオブジェクトを取得する。

戻り値

内部のbasic_spanbufオブジェクトへのポインタ。

例

#include <iostream>
#include <span>
#include <spanstream>

int main()
{
  char buf[32] = "test";
  std::ispanstream iss{std::span<char>{buf}};

  std::spanbuf* rd = iss.rdbuf();

  // バッファから文字を読み取り
  std::cout << static_cast<char>(rd->sbumpc()) << std::endl;
  std::cout << static_cast<char>(rd->sbumpc()) << std::endl;
  std::cout << static_cast<char>(rd->sbumpc()) << std::endl;
  std::cout << static_cast<char>(rd->sbumpc()) << std::endl;
}

出力

t
e
s
t

バージョン

言語

  • C++23

処理系

  • Clang: ??
  • GCC: ??
  • Visual C++: ??
You are visitor 01402520 — 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.