⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 istream.tcc

📁 gcc-you can use this code to learn something about gcc, and inquire further into linux,
💻 TCC
📖 第 1 页 / 共 3 页
字号:
	    {	      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);	      if (_M_check_facet(_M_fnumget))		_M_fnumget->get(*this, 0, *this, __err, __n);	      this->setstate(__err);	    }	  catch(...)	    {	      // 27.6.1.2.1 Common requirements.	      // Turn this on without causing an ios::failure to be thrown.	      this->_M_setstate(ios_base::badbit);	      if ((this->exceptions() & ios_base::badbit) != 0)		__throw_exception_again;	    }	}      return *this;    }  template<typename _CharT, typename _Traits>    basic_istream<_CharT, _Traits>&     basic_istream<_CharT, _Traits>::    operator>>(long double& __n)    {      sentry __cerb(*this, false);      if (__cerb) 	{	  try 	    {	      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);	      if (_M_check_facet(_M_fnumget))		_M_fnumget->get(*this, 0, *this, __err, __n);	      this->setstate(__err);	    }	  catch(...)	    {	      // 27.6.1.2.1 Common requirements.	      // Turn this on without causing an ios::failure to be thrown.	      this->_M_setstate(ios_base::badbit);	      if ((this->exceptions() & ios_base::badbit) != 0)		__throw_exception_again;	    }	}      return *this;    }  template<typename _CharT, typename _Traits>    basic_istream<_CharT, _Traits>&     basic_istream<_CharT, _Traits>::    operator>>(void*& __n)    {      sentry __cerb(*this, false);      if (__cerb) 	{	  try 	    {	      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);	      if (_M_check_facet(_M_fnumget))		_M_fnumget->get(*this, 0, *this, __err, __n);	      this->setstate(__err);	    }	  catch(...)	    {	      // 27.6.1.2.1 Common requirements.	      // Turn this on without causing an ios::failure to be thrown.	      this->_M_setstate(ios_base::badbit);	      if ((this->exceptions() & ios_base::badbit) != 0)		__throw_exception_again;	    }	}      return *this;    }  template<typename _CharT, typename _Traits>    basic_istream<_CharT, _Traits>&     basic_istream<_CharT, _Traits>::    operator>>(__streambuf_type* __sbout)    {       sentry __cerb(*this, false);       if (__cerb)	 {	   try	     {	       streamsize __xtrct = 0;	       if (__sbout)		 {		   __streambuf_type* __sbin = this->rdbuf();		   __xtrct = __copy_streambufs(*this, __sbin, __sbout);		 }	       if (!__sbout || !__xtrct)		 this->setstate(ios_base::failbit);	     }	   catch(...)	     {	       // 27.6.2.5.1 Common requirements.	       // Turn this on without causing an ios::failure to be thrown.	       this->_M_setstate(ios_base::badbit);	       if ((this->exceptions() & ios_base::badbit) != 0)		 __throw_exception_again;	     }	 }       return *this;    }  template<typename _CharT, typename _Traits>    typename basic_istream<_CharT, _Traits>::int_type    basic_istream<_CharT, _Traits>::    get(void)    {      const int_type __eof = traits_type::eof();      int_type __c = __eof;      _M_gcount = 0;      sentry __cerb(*this, true);      if (__cerb) 	{	  try 	    {	      __c = this->rdbuf()->sbumpc();	      // 27.6.1.1 paragraph 3	      if (!traits_type::eq_int_type(__c, __eof))		_M_gcount = 1;	      else		this->setstate(ios_base::eofbit | ios_base::failbit);	    }	  catch(...)	    {	      // 27.6.1.3 paragraph 1	      // Turn this on without causing an ios::failure to be thrown.	      this->_M_setstate(ios_base::badbit);	      if ((this->exceptions() & ios_base::badbit) != 0)		__throw_exception_again;	    }	}      return __c;    }  template<typename _CharT, typename _Traits>    basic_istream<_CharT, _Traits>&    basic_istream<_CharT, _Traits>::    get(char_type& __c)    {      _M_gcount = 0;      sentry __cerb(*this, true);      if (__cerb) 	{ 	  try 	    {	      const int_type __eof = traits_type::eof();	      int_type __bufval = this->rdbuf()->sbumpc();	      // 27.6.1.1 paragraph 3	      if (!traits_type::eq_int_type(__bufval, __eof))		{		  _M_gcount = 1;		  __c = traits_type::to_char_type(__bufval);		}	      else		this->setstate(ios_base::eofbit | ios_base::failbit);	    }	  catch(...)	    {	      // 27.6.1.3 paragraph 1	      // Turn this on without causing an ios::failure to be thrown.	      this->_M_setstate(ios_base::badbit);	      if ((this->exceptions() & ios_base::badbit) != 0)		__throw_exception_again;	    }	}      return *this;    }  template<typename _CharT, typename _Traits>    basic_istream<_CharT, _Traits>&    basic_istream<_CharT, _Traits>::    get(char_type* __s, streamsize __n, char_type __delim)    {      _M_gcount = 0;      sentry __cerb(*this, true);      if (__cerb) 	{	  try 	    {	      const int_type __idelim = traits_type::to_int_type(__delim);	      const int_type __eof = traits_type::eof();	      __streambuf_type* __sb = this->rdbuf();	      int_type __c = __sb->sgetc();		      	      while (_M_gcount + 1 < __n 		     && !traits_type::eq_int_type(__c, __eof)		     && !traits_type::eq_int_type(__c, __idelim))		{		  *__s++ = traits_type::to_char_type(__c);		  __c = __sb->snextc();		  ++_M_gcount;		}	      if (traits_type::eq_int_type(__c, __eof))		this->setstate(ios_base::eofbit);	    }	  catch(...)	    {	      // 27.6.1.3 paragraph 1	      // Turn this on without causing an ios::failure to be thrown.	      this->_M_setstate(ios_base::badbit);	      if ((this->exceptions() & ios_base::badbit) != 0)		__throw_exception_again;	    }	}      *__s = char_type();      if (!_M_gcount)	this->setstate(ios_base::failbit);      return *this;    }  template<typename _CharT, typename _Traits>    basic_istream<_CharT, _Traits>&    basic_istream<_CharT, _Traits>::    get(__streambuf_type& __sb, char_type __delim)    {      _M_gcount = 0;      sentry __cerb(*this, true);      if (__cerb) 	{	  try 	    {	      const int_type __idelim = traits_type::to_int_type(__delim);	      const int_type __eof = traits_type::eof();	      	      __streambuf_type* __this_sb = this->rdbuf();	      int_type __c = __this_sb->sgetc();	      char_type __c2 = traits_type::to_char_type(__c);	      	      while (!traits_type::eq_int_type(__c, __eof) 		     && !traits_type::eq_int_type(__c, __idelim) 		     && !traits_type::eq_int_type(__sb.sputc(__c2), __eof))		{		  ++_M_gcount;		  __c = __this_sb->snextc();		  __c2 = traits_type::to_char_type(__c);		}	      if (traits_type::eq_int_type(__c, __eof))		this->setstate(ios_base::eofbit);	    }	  catch(...)	    {	      // 27.6.1.3 paragraph 1	      // Turn this on without causing an ios::failure to be thrown.	      this->_M_setstate(ios_base::badbit);	      if ((this->exceptions() & ios_base::badbit) != 0)		__throw_exception_again;	    }	}      if (!_M_gcount)	this->setstate(ios_base::failbit);      return *this;    }  template<typename _CharT, typename _Traits>    basic_istream<_CharT, _Traits>&    basic_istream<_CharT, _Traits>::    getline(char_type* __s, streamsize __n, char_type __delim)    {      _M_gcount = 0;      sentry __cerb(*this, true);      if (__cerb) 	{          try 	    {	      const int_type __idelim = traits_type::to_int_type(__delim);	      const int_type __eof = traits_type::eof();	      __streambuf_type* __sb = this->rdbuf();	      int_type __c = __sb->sgetc();	    	      while (_M_gcount + 1 < __n 		     && !traits_type::eq_int_type(__c, __eof)		     && !traits_type::eq_int_type(__c, __idelim))		{		  *__s++ = traits_type::to_char_type(__c);		  __c = __sb->snextc();		  ++_M_gcount;		}	      if (traits_type::eq_int_type(__c, __eof))		this->setstate(ios_base::eofbit);	      else		{		  if (traits_type::eq_int_type(__c, __idelim))		    {		      __sb->sbumpc();		      ++_M_gcount;		    }		  else		    this->setstate(ios_base::failbit);		}	    }	  catch(...)	    {	      // 27.6.1.3 paragraph 1	      // Turn this on without causing an ios::failure to be thrown.	      this->_M_setstate(ios_base::badbit);	      if ((this->exceptions() & ios_base::badbit) != 0)		__throw_exception_again;	    }	}      *__s = char_type();      if (!_M_gcount)	this->setstate(ios_base::failbit);      return *this;    }    template<typename _CharT, typename _Traits>    basic_istream<_CharT, _Traits>&    basic_istream<_CharT, _Traits>::    ignore(streamsize __n, int_type __delim)    {      _M_gcount = 0;      sentry __cerb(*this, true);      if (__cerb && __n > 0) 	{	  try 	    {	      const int_type __eof = traits_type::eof();	      __streambuf_type* __sb = this->rdbuf();	      int_type __c;	      	      __n = min(__n, numeric_limits<streamsize>::max());	      while (_M_gcount < __n  		     && !traits_type::eq_int_type(__c = __sb->sbumpc(), __eof))		{		  ++_M_gcount;		  if (traits_type::eq_int_type(__c, __delim))		    break;		}	      if (traits_type::eq_int_type(__c, __eof))		this->setstate(ios_base::eofbit);	    }	  catch(...)	    {	      // 27.6.1.3 paragraph 1	      // Turn this on without causing an ios::failure to be thrown.	      this->_M_setstate(ios_base::badbit);	      if ((this->exceptions() & ios_base::badbit) != 0)		__throw_exception_again;	    }	}      return *this;    }    template<typename _CharT, typename _Traits>    typename basic_istream<_CharT, _Traits>::int_type    basic_istream<_CharT, _Traits>::    peek(void)    {      int_type __c = traits_type::eof();      _M_gcount = 0;      sentry __cerb(*this, true);      if (__cerb)	{	  try 	    { __c = this->rdbuf()->sgetc(); }	  catch(...)	    {	      // 27.6.1.3 paragraph 1	      // Turn this on without causing an ios::failure to be thrown.	      this->_M_setstate(ios_base::badbit);	      if ((this->exceptions() & ios_base::badbit) != 0)		__throw_exception_again;	    }	}       return __c;    }  template<typename _CharT, typename _Traits>    basic_istream<_CharT, _Traits>&    basic_istream<_CharT, _Traits>::    read(char_type* __s, streamsize __n)    {      _M_gcount = 0;      sentry __cerb(*this, true);      if (__cerb) 	{	  try 	    {	      _M_gcount = this->rdbuf()->sgetn(__s, __n);	      if (_M_gcount != __n)		this->setstate(ios_base::eofbit | ios_base::failbit);	    }	    	  catch(...)	    {	      // 27.6.1.3 paragraph 1	      // Turn this on without causing an ios::failure to be thrown.	      this->_M_setstate(ios_base::badbit);	      if ((this->exceptions() & ios_base::badbit) != 0)		__throw_exception_again;	    }	}      else	this->setstate(ios_base::failbit);      return *this;    }    template<typename _CharT, typename _Traits>    streamsize     basic_istream<_CharT, _Traits>::    readsome(char_type* __s, streamsize __n)    {      _M_gcount = 0;      sentry __cerb(*this, true);      if (__cerb) 	{	  try 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -