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>
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;
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')); }
602 seekg(off_type, ios_base::seekdir);
610 #if __cplusplus >= 201103L
639 template<
typename _ValueT>
660 #ifdef _GLIBCXX_USE_WCHAR_T
685 template<
typename _CharT,
typename _Traits>
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)); }
766 template<
typename _CharT,
typename _Traits>
768 __istream_extract(basic_istream<_CharT, _Traits>&, _CharT*,
streamsize);
799 #if __cplusplus <= 201703L
800 template<
typename _CharT,
typename _Traits>
801 __attribute__((__nonnull__(2), __access__(__write_only__, 2)))
802 inline basic_istream<_CharT, _Traits>&
805 size_t __n = __builtin_object_size(__s, 0);
806 if (__builtin_expect(__n <
sizeof(_CharT),
false))
809 __glibcxx_assert(__n >=
sizeof(_CharT));
815 if (__n == (
size_t)-1)
816 __n = __gnu_cxx::__numeric_traits<streamsize>::__max;
817 std::__istream_extract(__in, __s, __n /
sizeof(_CharT));
822 template<
class _Traits>
823 __attribute__((__nonnull__(2), __access__(__write_only__, 2)))
824 inline basic_istream<
char, _Traits>&
825 operator>>(basic_istream<
char, _Traits>& __in,
unsigned char* __s)
826 {
return __in >>
reinterpret_cast<char*
>(__s); }
828 template<
class _Traits>
829 __attribute__((__nonnull__(2), __access__(__write_only__, 2)))
830 inline basic_istream<
char, _Traits>&
831 operator>>(basic_istream<
char, _Traits>& __in,
signed char* __s)
832 {
return __in >>
reinterpret_cast<char*
>(__s); }
836 template<
typename _CharT,
typename _Traits,
size_t _Num>
837 inline basic_istream<_CharT, _Traits>&
838 operator>>(basic_istream<_CharT, _Traits>& __in, _CharT (&__s)[_Num])
840 static_assert(_Num <= __gnu_cxx::__numeric_traits<streamsize>::__max);
841 std::__istream_extract(__in, __s, _Num);
845 template<
class _Traits,
size_t _Num>
846 inline basic_istream<char, _Traits>&
847 operator>>(basic_istream<char, _Traits>& __in,
unsigned char (&__s)[_Num])
848 {
return __in >>
reinterpret_cast<char(&)[_Num]
>(__s); }
850 template<
class _Traits,
size_t _Num>
851 inline basic_istream<char, _Traits>&
852 operator>>(basic_istream<char, _Traits>& __in,
signed char (&__s)[_Num])
853 {
return __in >>
reinterpret_cast<char(&)[_Num]
>(__s); }
868 template<
typename _CharT,
typename _Traits>
877 typedef _CharT char_type;
878 typedef typename _Traits::int_type int_type;
879 typedef typename _Traits::pos_type pos_type;
880 typedef typename _Traits::off_type off_type;
881 typedef _Traits traits_type;
905 : __istream_type(), __ostream_type() { }
907 #if __cplusplus >= 201103L
908 basic_iostream(
const basic_iostream&) =
delete;
910 basic_iostream(basic_iostream&& __rhs)
911 : __istream_type(
std::move(__rhs)), __ostream_type(*this)
919 operator=(basic_iostream&& __rhs)
926 swap(basic_iostream& __rhs)
951 template<
typename _CharT,
typename _Traits>
952 basic_istream<_CharT, _Traits>&
953 ws(basic_istream<_CharT, _Traits>& __is);
955 #if __cplusplus >= 201103L
956 template<
typename _Ch,
typename _Up>
957 basic_istream<_Ch, _Up>&
958 __is_convertible_to_basic_istream_test(basic_istream<_Ch, _Up>*);
960 template<
typename _Tp,
typename =
void>
961 struct __is_convertible_to_basic_istream_impl
963 using __istream_type = void;
966 template<
typename _Tp>
967 using __do_is_convertible_to_basic_istream_impl =
968 decltype(__is_convertible_to_basic_istream_test
969 (declval<
typename remove_reference<_Tp>::type*>()));
971 template<
typename _Tp>
972 struct __is_convertible_to_basic_istream_impl
974 __void_t<__do_is_convertible_to_basic_istream_impl<_Tp>>>
976 using __istream_type =
977 __do_is_convertible_to_basic_istream_impl<_Tp>;
980 template<
typename _Tp>
981 struct __is_convertible_to_basic_istream
982 : __is_convertible_to_basic_istream_impl<_Tp>
985 using type = __not_<is_void<
986 typename __is_convertible_to_basic_istream_impl<_Tp>::__istream_type>>;
987 constexpr
static bool value = type::value;
990 template<
typename _Istream,
typename _Tp,
typename =
void>
993 template<
typename _Istream,
typename _Tp>
994 struct __is_extractable<_Istream, _Tp,
995 __void_t<decltype(declval<_Istream&>()
999 template<
typename _Istream>
1000 using __rvalue_istream_type =
1001 typename __is_convertible_to_basic_istream<
1002 _Istream>::__istream_type;
1017 template<
typename _Istream,
typename _Tp>
1019 typename enable_if<__and_<__not_<is_lvalue_reference<_Istream>>,
1020 __is_convertible_to_basic_istream<_Istream>,
1022 __rvalue_istream_type<_Istream>,
1024 __rvalue_istream_type<_Istream>>::type
1027 __rvalue_istream_type<_Istream> __ret_is = __is;
1028 __ret_is >> std::forward<_Tp>(__x);
1033 _GLIBCXX_END_NAMESPACE_VERSION
basic_istream< char > istream
Base class for char input streams.
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
void swap(any &__x, any &__y) noexcept
Exchange the states of two any objects.
ISO C++ entities toplevel namespace is std.
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.
basic_istream< _CharT, _Traits > & ws(basic_istream< _CharT, _Traits > &__is)
Quick and easy way to eat whitespace.
Template class basic_ios, virtual base class for all stream classes.
void init(basic_streambuf< _CharT, _Traits > *__sb)
All setup is performed here.
char_type widen(char __c) const
Widens characters.
The actual work of input and output (interface).
Template class basic_istream.
__istream_type & seekg(pos_type)
Changing the current read position.
streamsize gcount() const
Character counting.
int_type get()
Simple extraction.
streamsize readsome(char_type *__s, streamsize __n)
Extraction until the buffer is exhausted, but no more.
__istream_type & operator>>(long double &__f)
Integer arithmetic extractors.
int_type peek()
Looking ahead in the stream.
__istream_type & get(char_type *__s, streamsize __n)
Simple multiple-character extraction.
__istream_type & unget()
Unextracting the previous character.
void swap(basic_istream &__rhs)
Simple extraction.
pos_type tellg()
Getting the current read position.
__istream_type & operator>>(long &__n)
Integer arithmetic extractors.
__istream_type & getline(char_type *__s, streamsize __n)
String extraction.
__istream_type & get(__streambuf_type &__sb)
Extraction into another streambuf.
__istream_type & ignore()
Simple extraction.
__istream_type & operator>>(unsigned long &__n)
Integer arithmetic extractors.
virtual ~basic_istream()
Base destructor.
basic_istream(const basic_istream &)=delete
Simple extraction.
basic_istream(basic_istream &&__rhs)
Simple extraction.
basic_istream & operator=(basic_istream &&__rhs)
Simple extraction.
__istream_type & operator>>(long long &__n)
Integer arithmetic extractors.
__istream_type & operator>>(unsigned long long &__n)
Integer arithmetic extractors.
__istream_type & read(char_type *__s, streamsize __n)
Extraction without delimiters.
__istream_type & _M_extract(_ValueT &__v)
Simple extraction.
__istream_type & putback(char_type __c)
Unextracting a single character.
__istream_type & operator>>(float &__f)
Floating point arithmetic extractors.
basic_istream(__streambuf_type *__sb)
Base constructor.
__istream_type & operator>>(unsigned int &__n)
Integer arithmetic extractors.
basic_istream()
Simple extraction.
__istream_type & getline(char_type *__s, streamsize __n, char_type __delim)
String extraction.
__istream_type & operator>>(void *&__p)
Basic arithmetic extractors.
__istream_type & operator>>(bool &__n)
Integer arithmetic extractors.
basic_istream & operator=(const basic_istream &)=delete
Simple extraction.
int sync()
Synchronizing the stream buffer.
__istream_type & operator>>(__istream_type &(*__pf)(__istream_type &))
Interface for manipulators.
__istream_type & operator>>(double &__f)
Integer arithmetic extractors.
__istream_type & operator>>(unsigned short &__n)
Integer arithmetic extractors.
Template class basic_ostream.
Template class basic_iostream.
basic_iostream(basic_streambuf< _CharT, _Traits > *__sb)
Constructor does nothing.
virtual ~basic_iostream()
Destructor does nothing.
Performs setup work for input streams.
_Traits traits_type
Easy access to dependent types.
static const iostate failbit
Indicates that an input operation failed to read the expected characters, or that an output operation...
Primary class template ctype facet.
Primary class template num_get.