名前空間
変種
操作

std::basic_istream::putback

提供: cppreference.com
< cpp‎ | io‎ | basic istream

 
 
 
std::basic_istream
グローバルオブジェクト
Original:
Global objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
メンバ関数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
書式付き入力
Original:
Formatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
書式なし入力
Original:
Unformatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istream::putback
ポジショニング
Original:
Positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
その他
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
メンバークラス
Original:
Member classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
非メンバ関数
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
basic_istream& putback( char_type ch );
次の抽出された文字がchすることができるようになるchバック入力ストリームに文字を入れ.
Original:
Puts the character ch back to the input stream so the next extracted character will be ch.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
最初はeofbitクリアし、その後UnformattedInputFunctionとして動作します。 rdbuf()がNULLでない場合は、構築および監視オブジェクトをチェックした後、行い、最近、抽出された文字rdbuf()->sputbackc(ch)等しくない場合rdbuf()->pbackfail(ch)を呼び出しchは、呼び出し.
Original:
First clears eofbit, then behaves as UnformattedInputFunction. After constructing and checking the sentry object, if rdbuf() is not null, calls rdbuf()->sputbackc(ch), which calls rdbuf()->pbackfail(ch) if ch does not equal the most recently extracted character.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rdbuf()がnullであるか、rdbuf->sputbackc(ch)返しTraits::eof()setstate(badbit)呼び出す場合..場合
Original:
If rdbuf() is null or if rdbuf->sputbackc(ch) returns Traits::eof(), calls setstate(badbit).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
いずれにせよ、gcount()はカウンタをゼロに設定します。.
Original:
In any case, sets the gcount() counter to zero.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

(なし)

[編集] 値を返します

*this

[編集]

プットバック()を変更し、非改変の違いを示します
Original:
demonstrates the difference between modifying and non-modifying putback()
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <sstream>
#include <iostream>
int main()
{
    std::stringstream s1("Hello, world"); // IO stream
    s1.get();
    if(s1.putback('Y')) // modifies the buffer
        std::cout << s1.rdbuf() << '\n';
    else
        std::cout << "putback failed\n";
 
    std::istringstream s2("Hello, world"); // input-only stream
    s2.get();
    if(s2.putback('Y')) // cannot modify input-only buffer
        std::cout << s2.rdbuf() << '\n';
    else
        std::cout << "putback failed\n";
 
    s2.clear();
    if(s2.putback('H')) // non-modifying putback
        std::cout << s2.rdbuf() << '\n';
    else
        std::cout << "putback failed\n";
}

出力:

Yello, world
putback failed
Hello, world

[編集] 参照

文字の抽出を取り消します
Original:
unextracts a character
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
文字を抽出せずに読み込みます
Original:
reads the next character without extracting it
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]