名前空間
変種
操作

「cpp/io/basic istream/swap」の版間の差分

提供: cppreference.com
< cpp‎ | io‎ | basic istream
(r2.7.3) (ロボットによる 追加: de, en, es, fr, it, pt, ru, zh)
(Use {{lc}}. Update links. Various fixes.)
2行: 2行:
 
{{cpp/io/basic_istream/title | swap}}
 
{{cpp/io/basic_istream/title | swap}}
 
{{cpp/io/basic_istream/navbar}}
 
{{cpp/io/basic_istream/navbar}}
{{ddcl list begin}}
+
{{begin}}
{{ddcl list item |notes={{mark since c++11}} |1=
+
{{| =c++11 |1=
 
protected:
 
protected:
 
void swap(basic_istream& rhs);
 
void swap(basic_istream& rhs);
 
}}
 
}}
{{ddcl list end}}
+
{{end}}
  
{{tr|{{c|basic_ios::swap(rhs)}}は、すべてのデータ{{c|rdbuf()}}を除く基本クラスのメンバ、およびスワップ{{rlpf|gcount}}と{{c|*this}}の間{{tt|rhs}}カウンタの値を交換するために呼び出す。このスワップ機能が保護されています:それは、スワップ可能な入力ストリームクラスのスワップ機能によって呼び出され{{c|std::basic_ifstream}}と{{c|std::basic_istringstream}}、正しく関連付けstreambuffersを交換する方法を知っている.|Calls {{c|basic_ios::swap(rhs)}} to swap all data members of the base class except for {{c|rdbuf()}}, and swaps the values of the {{rlpf|gcount}} counters between {{c|*this}} and {{tt|rhs}}. This swap function is protected: it is called by the swap functions of the swappable input stream classes {{c|std::basic_ifstream}} and {{c|std::basic_istringstream}}, which know how to correctly swap the associated streambuffers.}}
+
{{tr|{{c|basic_ios::swap(rhs)}}は、すべてのデータ{{c|rdbuf()}}を除く基本クラスのメンバ、およびスワップ{{rlpf|gcount}}と{{c|*this}}の間{{tt|rhs}}カウンタの値を交換するために呼び出す。このスワップ機能が保護されています:それは、スワップ可能な入力ストリームクラスのスワップ機能によって呼び出され{{|std::basic_ifstream}}と{{|std::basic_istringstream}}、正しく関連付けstreambuffersを交換する方法を知っている.|Calls {{c|basic_ios::swap(rhs)}} to swap all data members of the base class except for {{c|rdbuf()}}, and swaps the values of the {{rlpf|gcount}} counters between {{c|*this}} and {{tt|rhs}}. This swap function is protected: it is called by the swap functions of the swappable input stream classes {{|std::basic_ifstream}} and {{|std::basic_istringstream}}, which know how to correctly swap the associated streambuffers.}}
  
 
===パラメータ===
 
===パラメータ===
{{param list begin}}
+
{{begin}}
{{param list item | rhs |{{tr| と交換するために、同じタイプの別のオブジェクトbasic_istream| different basic_istream object of the same type to swap with}}}}
+
{{| rhs |{{tr| と交換するために、同じタイプの別のオブジェクトbasic_istream| different basic_istream object of the same type to swap with}}}}
{{param list end}}
+
{{end}}
  
 
===例===
 
===例===

2013年7月2日 (火) 13:19時点における版

 
 
入出力ライブラリ
入出力マニピュレータ
Cスタイルの入出力
バッファ
(C++98で非推奨)
ストリーム
抽象
ファイル入出力
文字列入出力
配列入出力
(C++98で非推奨)
(C++98で非推奨)
(C++98で非推奨)
同期化出力
エラーカテゴリインタフェース
(C++11)
 
 
protected:
void swap(basic_istream& rhs);
(C++11以上)
basic_ios::swap(rhs)は、すべてのデータrdbuf()を除く基本クラスのメンバ、およびスワップgcount()*thisの間rhsカウンタの値を交換するために呼び出す。このスワップ機能が保護されています:それは、スワップ可能な入力ストリームクラスのスワップ機能によって呼び出されstd::basic_ifstreamstd::basic_istringstream、正しく関連付けstreambuffersを交換する方法を知っている.
Original:
Calls basic_ios::swap(rhs) to swap all data members of the base class except for rdbuf(), and swaps the values of the gcount() counters between *this and rhs. This swap function is protected: it is called by the swap functions of the swappable input stream classes std::basic_ifstream and