33 #ifndef _GLIBCXX_ISTREAM
34 #define _GLIBCXX_ISTREAM 1
36 #pragma GCC system_header
41 namespace std _GLIBCXX_VISIBILITY(default)
43 _GLIBCXX_BEGIN_NAMESPACE_VERSION
57 template<
typename _CharT,
typename _Traits>
58 class basic_istream :
virtual public basic_ios<_CharT, _Traits>
62 typedef _CharT char_type;
63 typedef typename _Traits::int_type int_type;
64 typedef typename _Traits::pos_type pos_type;
65 typedef typename _Traits::off_type off_type;
66 typedef _Traits traits_type;
69 typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
70 typedef basic_ios<_CharT, _Traits> __ios_type;
71 typedef basic_istream<_CharT, _Traits> __istream_type;
72 typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
74 typedef ctype<_CharT> __ctype_type;
121 {
return __pf(*
this); }
193 #ifdef _GLIBCXX_USE_LONG_LONG
355 {
return this->
get(__s, __n, this->widen(
'\n')); }
377 get(__streambuf_type& __sb, char_type __delim);
388 {
return this->
get(__sb, this->widen(
'\n')); }
428 {
return this->
getline(__s, __n, this->widen(
'\n')); }
602 seekg(off_type, ios_base::seekdir);
610 #if __cplusplus >= 201103L
634 __ios_type::swap(__rhs);
639 template<
typename _ValueT>
660 #ifdef _GLIBCXX_USE_WCHAR_T
662 basic_istream<wchar_t>&
667 basic_istream<wchar_t>&
672 basic_istream<wchar_t>&
685 template<
typename _CharT,
typename _Traits>
696 typedef typename __istream_type::__ctype_type __ctype_type;
697 typedef typename _Traits::int_type __int_type;
731 #if __cplusplus >= 201103L
734 operator bool()
const
750 template<
typename _CharT,
typename _Traits>
754 template<
class _Traits>
757 {
return (__in >>
reinterpret_cast<char&
>(__c)); }
759 template<
class _Traits>
760 inline basic_istream<char, _Traits>&
761 operator>>(basic_istream<char, _Traits>& __in,
signed char& __c)
762 {
return (__in >>
reinterpret_cast<char&
>(__c)); }
792 template<
typename _CharT,
typename _Traits>
793 basic_istream<_CharT, _Traits>&
794 operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s);
799 operator>>(basic_istream<char>& __in,
char* __s);
801 template<
class _Traits>
802 inline basic_istream<char, _Traits>&
803 operator>>(basic_istream<char, _Traits>& __in,
unsigned char* __s)
804 {
return (__in >>
reinterpret_cast<char*
>(__s)); }
806 template<
class _Traits>
807 inline basic_istream<char, _Traits>&
808 operator>>(basic_istream<char, _Traits>& __in,
signed char* __s)
809 {
return (__in >>
reinterpret_cast<char*
>(__s)); }
823 template<
typename _CharT,
typename _Traits>
825 :
public basic_istream<_CharT, _Traits>,
826 public basic_ostream<_CharT, _Traits>
832 typedef _CharT char_type;
833 typedef typename _Traits::int_type int_type;
834 typedef typename _Traits::pos_type pos_type;
835 typedef typename _Traits::off_type off_type;
836 typedef _Traits traits_type;
839 typedef basic_istream<_CharT, _Traits> __istream_type;
840 typedef basic_ostream<_CharT, _Traits> __ostream_type;
860 : __istream_type(), __ostream_type() { }
862 #if __cplusplus >= 201103L
863 basic_iostream(
const basic_iostream&) =
delete;
865 basic_iostream(basic_iostream&& __rhs)
866 : __istream_type(
std::
move(__rhs)), __ostream_type(*this)
874 operator=(basic_iostream&& __rhs)
881 swap(basic_iostream& __rhs)
906 template<
typename _CharT,
typename _Traits>
907 basic_istream<_CharT, _Traits>&
908 ws(basic_istream<_CharT, _Traits>& __is);
910 #if __cplusplus >= 201103L
911 template<
typename _Ch,
typename _Up>
912 basic_istream<_Ch, _Up>&
913 __is_convertible_to_basic_istream_test(basic_istream<_Ch, _Up>*);
915 template<
typename _Tp,
typename =
void>
916 struct __is_convertible_to_basic_istream_impl
918 using __istream_type = void;
921 template<
typename _Tp>
922 using __do_is_convertible_to_basic_istream_impl =
923 decltype(__is_convertible_to_basic_istream_test
924 (declval<
typename remove_reference<_Tp>::type*>()));
926 template<
typename _Tp>
927 struct __is_convertible_to_basic_istream_impl
929 __void_t<__do_is_convertible_to_basic_istream_impl<_Tp>>>
931 using __istream_type =
932 __do_is_convertible_to_basic_istream_impl<_Tp>;
935 template<
typename _Tp>
936 struct __is_convertible_to_basic_istream
937 : __is_convertible_to_basic_istream_impl<_Tp>
940 using type = __not_<is_void<
941 typename __is_convertible_to_basic_istream_impl<_Tp>::__istream_type>>;
942 constexpr
static bool value = type::value;
945 template<
typename _Istream,
typename _Tp,
typename =
void>
948 template<
typename _Istream,
typename _Tp>
949 struct __is_extractable<_Istream, _Tp,
950 __void_t<decltype(declval<_Istream&>()
954 template<
typename _Istream>
955 using __rvalue_istream_type =
956 typename __is_convertible_to_basic_istream<
957 _Istream>::__istream_type;
972 template<
typename _Istream,
typename _Tp>
974 typename enable_if<__and_<__not_<is_lvalue_reference<_Istream>>,
975 __is_convertible_to_basic_istream<_Istream>,
977 __rvalue_istream_type<_Istream>,
979 __rvalue_istream_type<_Istream>>::type
982 __rvalue_istream_type<_Istream> __ret_is = __is;
983 __ret_is >> std::forward<_Tp>(__x);
988 _GLIBCXX_END_NAMESPACE_VERSION