名前空間
変種
操作

std::ws

提供: cppreference.com
< cpp‎ | io‎ | manip

 
 
 
入出力マニピュレータ
浮動小数点フォーマット
整数フォーマット
ブーリアンフォーマット
フィールド幅とフィル制御
その他のフォーマット
ホワイトスペース処理
ws
出力のフラッシュ
ステータスフラグ操作
時間と通貨の入出力
(C++11)
(C++11)
(C++11)
(C++11)
引用符マニピュレータ
(C++14)
 
ヘッダ <istream> で定義
template< class CharT, class Traits >
std::basic_istream<CharT,Traits>& ws( std::basic_istream<CharT, Traits>& is );
破棄し、入力ストリームから先頭の空白は.
Original:
Discards leading whitespace from an input stream.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
UnformattedInputFunctionが変更されていないことを除けば、is.gcount()として動作します。監視オブジェクトを構築し、確認した後、ストリームから文字を抽出し、次のいずれかの条件が発生するまで、それらを廃棄します
Original:
Behaves as an UnformattedInputFunction, except that is.gcount() is not modified. After constructing and checking the sentry object, extracts characters from the stream and discards them until any one of the following conditions occurs:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • ファイルの終わり状態は、入力シーケンスで発生する(そのような場合には、関数を呼び出すsetstate(eofbit)が、設定することはありませんfailbit.
    Original:
    end of file condition occurs in the input sequence (in which case the function calls setstate(eofbit) but does not set failbit.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 入力シーケンス内の次の使用可能な文字cstd::isspace(c, is.getloc())によって決定されるように空白ではありません。非空白文字ではありません抽出された.
    Original:
    the next available character c in the input sequence is not whitespace as determined by std::isspace(c, is.getloc()). The non-whitespace character is not extracted.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
これは入力専用のI / Oマニピュレータですが、それはそのようなタイプの任意のin << std::wsためinとして式と呼ばれるかもしれstd::basic_istream.
Original:
This is an input-only I/O manipulator, it may be called with an expression such as in << std::ws for any in of type std::basic_istream.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

is -
入力ストリームへの参照
Original:
reference to input stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

is(連続した空白を抽出した後のストリームへの参照)
Original:
is (reference to the stream after extraction of consecutive whitespace)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

#include <iostream>
#include <sstream>
int main()
{
    std::istringstream s("     this is a test");
    std::string line;
    s >> std::ws;
    getline(s, line);
    std::cout << "ws + getline returns: \"" << line << "\"\n";
}

出力:

ws + getline returns: "this is a test"

[編集] 参照

指定された文字が発見されるまで文字を抽出して破棄します
Original:
extracts and discards characters until the given character is found
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(std::basic_istreamのパブリックメンバ関数) [edit]