「メソッド」の実装は、istringstream getと言っています
int get();
Extracts a character from the stream and returns its value (casted to an integer).
私はその実装を見たかった。
編集:移植しようとしている部分を削除しました
「メソッド」の実装は、istringstream getと言っています
int get();
Extracts a character from the stream and returns its value (casted to an integer).
私はその実装を見たかった。
編集:移植しようとしている部分を削除しました
std::istringstreamヘッダーにあります<sstream>。しかし、get()方法ではありません。メンバーは、ヘッダーにget()あるテンプレートから継承されbasic_istream<_Elem, _Traits>ます。これが私のVS2005インストールからの実装です:
int_type __CLR_OR_THIS_CALL get()
{ // extract a metacharacter
int_type _Meta = 0;
ios_base::iostate _State = ios_base::goodbit;
_Chcount = 0;
const sentry _Ok(*this, true);
if (!_Ok)
_Meta = _Traits::eof(); // state not okay, return EOF
else
{ // state okay, extract a character
_TRY_IO_BEGIN
_Meta = _Myios::rdbuf()->sbumpc();
if (_Traits::eq_int_type(_Traits::eof(), _Meta))
_State |= ios_base::eofbit | ios_base::failbit; // end of file
else
++_Chcount; // got a character, count it
_CATCH_IO_END
}
_Myios::setstate(_State);
return (_Meta);
}