名前空間
変種
操作

operator<<<div class="t-tr-text">(スタンダード::あるbasic_ostream)<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">Original:</div><div class="t-tr-dropdown-orig">(std::basic_ostream)</div><div class="t-tr-dropdown-notes">The text has been machine-translated via [http://translate.google.com Google Translate].<br/> You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.</div></div></div></div></div>

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

 
 
入力/出力ライブラリ
I / Oのマニピュレータ
CスタイルのI / O
バッファ
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf
basic_filebuf
basic_stringbuf
strstreambuf(廃止予定)
ストリーム
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
抽象化
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base
basic_ios
basic_istream
basic_ostream
basic_iostream
ファイルI / O
Original:
File I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ifstream
basic_ofstream
basic_fstream
文字列I / O
Original:
String I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istringstream
basic_ostringstream
basic_stringstream
アレイのI / O
Original:
Array I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
istrstream(廃止予定)
ostrstream(廃止予定)
strstream(廃止予定)
タイプ
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
streamoff
streamsize
fpos
エラーカテゴリインターフェース
Original:
Error category interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iostream_category(C++11)
io_errc(C++11)
 
std::basic_ostream
グローバルオブジェクト
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.
basic_ostream::basic_ostream
basic_ostream::~basic_ostream
basic_ostream::operator=(C++11)
書式付き入力
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.
basic_ostream::operator<<
書式なし入力
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_ostream::put
basic_ostream::write
ポジショニング
Original:
Positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::tellp
basic_ostream::seekp
その他
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::flush
basic_ostream::swap(C++11)
メンバークラス
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.
basic_ostream::sentry
非メンバ関数
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.
operator<<(std::basic_ostream)
 
template< class CharT, class Traits>

basic_ostream<CharT,Traits>& operator<<( basic_ostream<CharT,Traits>& os,
                                         CharT ch );
template< class CharT, class Traits>
basic_ostream<CharT,Traits>& operator<<( basic_ostream<CharT,Traits>& os,
                                         char ch );
template< class Traits >
basic_ostream<char,Traits>& operator<<( basic_ostream<char,Traits>& os,
                                        char ch );
template< class Traits >
basic_ostream<char,Traits>& operator<<( basic_ostream<char,Traits>& os,
                                        signed char ch );
template< class Traits >
basic_ostream<char,Traits>& operator<<( basic_ostream<char,Traits>& os,

                                        unsigned char ch );
(1)
template< class CharT, class Traits >

basic_ostream<CharT,Traits>& operator<<( basic_ostream<CharT,Traits>& os,
                                         const CharT* s );
template< class CharT, class Traits >
basic_ostream<CharT,Traits>& operator<<( basic_ostream<CharT,Traits>& os,
                                         const char* s );
template< class Traits >
basic_ostream<char,Traits>& operator<<( basic_ostream<char,Traits>& os,  
                                        const char* s );
template< class Traits >
basic_ostream<char,Traits>& operator<<( basic_ostream<char,Traits>& os,
                                        const signed char* s );
template< class Traits >
basic_ostream<char,Traits>& operator<<( basic_ostream<char,traits>& os,

                                        const unsigned char* s );
(2)
template< class CharT, class Traits, class T >

basic_ostream< charT, traits >& operator<<( basic_ostream<CharT,Traits>&& os,

                                            const T& value );
(3) (C++11およびそれ以降)
挿入した文字または文字列.
Original:
Inserts a character or a character string.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1-2)
出力関数をフォーマットされています:彼らは、フラッシュしsentry'd出力バッファが必要であれば、型tie()のオブジェクトを作成することにより、実行を開始し、ストリームのエラーをチェックします。建設後、false監視オブジェクトを返した場合、これらの関数は、任意の出力をしようとせずに戻ります。エラーが出力中に発生した場合、これらの関数はsetstate(ios_base::failbit)を呼び出します。例外が出力時にスローされた場合、その後はios :: badbitをは(exceptions()&badbit) != 0が、その場合、それがスローされない限り、例外が抑制されている)が設定されます
Original:
are formatted output functions: they begin execution by constructing an object of type sentry, which flushes the tie()'d output buffers if necessary and checks the stream errors. After construction, if the sentry object returns false, these functions return without attempting any output. If an error occurs during output, these functions call setstate(ios_base::failbit). If an exception is thrown during output, then ios::badbit is set (the exception is suppressed unless exceptions()&badbit) != 0, in which case it is rethrown)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
挿入文字ch。文字の種類はCharTされていない場合は、まずos.widen(ch)に変換されます。パディングはnum_put::put()のステージ3の場合と同様にして決定されます。挿入後、width(0)が呼び出されます.
Original:
Inserts a character ch. If the type of the character is not CharT, it is first converted with os.widen(ch). Padding is determined as if by Stage 3 of num_put::put(). After insertion, width(0) is called.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
挿入最初の要素sによって指された文字配列から連続する文字.
Original:
Inserts successive characters from the character array whose first element is pointed to by s.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • 第一及び第三オーバーロード(CharTchのタイプと一致している)のために、正確にtraits::length(s)文字が挿入され.
    Original:
    for the first and third overloads (where CharT matches the type of ch), exactly traits::length(s) characters are inserted.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 第二過負荷のために、正確にstd::char_traits<char>::length(s)文字が挿入され.
    Original:
    for the second overload, exactly std::char_traits<char>::length(s) characters are inserted.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 最後の二つのオーバーロードのために、正確にtraits::length(reinterpret_cast<const char*>(s))が挿入され.
    Original:
    for the last two overloads, exactly traits::length(reinterpret_cast<const char*>(s)) are inserted.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
パディングはnum_put::put()のステージ3の場合と同様にして決定されます。すべての文字は、挿入前にos.widen()を使って拡大しています。挿入後、width(0)が呼び出されます.
Original:
Padding is determined as if by Stage 3 of num_put::put(). All characters are widened using os.widen() before insertion. After insertion, width(0) is called.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
出力ストリームオブジェクトへの右辺値参照を指定して、適切な挿入演算子は、(os << valueに相当)を呼び出し.
Original:
Calls the appropriate insertion operator, given an rvalue reference to an output stream object (equivalent to os << value).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

os -
出力ストリームにデータを挿入する
Original:
output stream to insert data to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ch -
挿入する文字への参照
Original:
reference to a character to insert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
s -
挿入する文字列へのポインタ
Original:
pointer to a character string to insert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

st

[編集]

#include <iostream>
#include <sstream>
int main()
{
    std::cout << "Hello, world" // the const char* overlaod
              << '\n';          // the char overload
    std::string s = (std::ostringstream() << 1.2).str(); // rvalue overload
    std::cout << s << '\n';
}

Output:

Hello, world
1.2

[編集] も参照してください

挿入してデータをフォーマットします
Original:
inserts formatted data
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

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