名前空間
変種
操作

std::streamsize

From cppreference.com
< cpp‎ | io
 
 
 
ヘッダ<ios>で定義
typedef /*実装定義*/ streamsize;

std::streamsize は、I/O 操作で転送された文字数またはI/O バッファのサイズを表すために使用される符号付き整数型です。これは、POSIX 型 ssize_t と同様に、std::size_t の符号付き対応として使用されます。

[編集] 注意

std::strstreambuf のコンストラクタ内を除き、std::streamsize の負の値は決して使用されません。

[編集]

#include <iostream>
#include <type_traits>
 
static_assert(std::is_signed_v<std::streamsize>);
 
int main()
{
    std::cout << sizeof(std::streamsize) << '\n';
}

実行結果の例

8

[編集] 関連項目

最後の書式なし入力操作によって抽出された文字数を返す
(std::basic_istream<CharT,Traits> の public メンバ関数) [編集]
指定された文字が見つかるまで文字を抽出して破棄する
(std::basic_istream<CharT,Traits> の public メンバ関数) [編集]
文字のブロックを抽出する
(std::basic_istream<CharT,Traits> の public メンバ関数) [編集]
文字ブロックを挿入する
(std::basic_ostream<CharT,Traits> の public メンバ関数) [編集]
English 日本語 中文(简体) 中文(繁體)