Skip to content

Latest commit

 

History

History
92 lines (71 loc) · 2.99 KB

File metadata and controls

92 lines (71 loc) · 2.99 KB

basic_ispanstream

  • spanstream[meta header]
  • std[meta namespace]
  • class template[meta id-type]
  • cpp23[meta cpp]
  • ispanstream,wispanstream[meta alias]
namespace std {
  template <class CharT,
            class Traits = char_traits<CharT> >
  class basic_ispanstream : public basic_istream<CharT, Traits>;

  using ispanstream  = basic_ispanstream<char>;
  using wispanstream = basic_ispanstream<wchar_t>;
}
  • char_traits[link /reference/string/char_traits.md]
  • basic_istream[link /reference/istream/basic_istream.md]

概要

std::basic_ospanstreamクラスは、std::span を使用した固定長ストリームバッファを入力元とする入力ストリームである。

メンバ関数

名前 説明 対応バージョン
(constructor) コンストラクタ C++23
operator= ムーブ代入 C++23
swap 値の交換 C++23
rdbuf ストリームバッファオブジェクトの設定・取得 C++23
span std::spanオブジェクトの設定・取得 C++23

非メンバ関数

名前 説明 対応バージョン
swap 2つのオブジェクトを入れ替える C++11

メンバ型

名前 説明 対応バージョン
char_type テンプレート仮引数CharT C++23
int_type Traits::int_type C++23
pos_type Traits::pos_type C++23
off_type Traits::off_type C++23
traits_type テンプレート仮引数Traits C++23

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

int main()
{
  char abc[3] = {'A', 'B', 'C'};
  std::span<char> span{abc};
  std::ispanstream iss(span);

  char c;
  while (iss >> c) {
    std::cout << c << ' ';
  }
  std::cout << std::endl;
}
  • std::ispanstream[color ff0000]
  • std::span[link /reference/span/span.md]

出力

A B C 

バージョン

言語

  • C++23

処理系

参照