30 #ifndef _STREAM_ITERATOR_H
31 #define _STREAM_ITERATOR_H 1
33 #pragma GCC system_header
40 namespace std _GLIBCXX_VISIBILITY(default)
42 _GLIBCXX_BEGIN_NAMESPACE_VERSION
50 #pragma GCC diagnostic push
51 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
54 template<
typename _Tp,
typename _CharT = char,
55 typename _Traits = char_traits<_CharT>,
typename _Dist = ptrdiff_t>
57 :
public iterator<input_iterator_tag, _Tp, _Dist, const _Tp*, const _Tp&>
60 typedef _CharT char_type;
61 typedef _Traits traits_type;
76 : _M_stream(0), _M_value(), _M_ok(false) {}
86 : _M_stream(__obj._M_stream), _M_value(__obj._M_value),
90 #if __cplusplus > 201703L && __cpp_lib_concepts
93 noexcept(is_nothrow_default_constructible_v<_Tp>)
97 #if __cplusplus >= 201103L
104 operator*() const _GLIBCXX_NOEXCEPT
106 __glibcxx_requires_cond(_M_ok,
107 _M_message(__gnu_debug::__msg_deref_istream)
108 ._M_iterator(*
this));
114 operator->() const _GLIBCXX_NOEXCEPT
120 __glibcxx_requires_cond(_M_ok,
121 _M_message(__gnu_debug::__msg_inc_istream)
122 ._M_iterator(*
this));
130 __glibcxx_requires_cond(_M_ok,
131 _M_message(__gnu_debug::__msg_inc_istream)
132 ._M_iterator(*
this));
144 return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream);
150 if (_M_stream && !(*_M_stream >> _M_value))
163 {
return __x._M_equal(__y); }
165 #if __cpp_impl_three_way_comparison < 201907L
172 {
return !__x._M_equal(__y); }
175 #if __cplusplus > 201703L && __cpp_lib_concepts
179 {
return !__i._M_stream; }
194 template<
typename _Tp,
typename _CharT = char,
195 typename _Traits = char_traits<_CharT> >
197 :
public iterator<output_iterator_tag, void, void, void, void>
202 #if __cplusplus > 201703L
212 const _CharT* _M_string;
234 : _M_stream(__obj._M_stream), _M_string(__obj._M_string) { }
236 #if __cplusplus >= 201103L
245 __glibcxx_requires_cond(_M_stream != 0,
246 _M_message(__gnu_debug::__msg_output_ostream)
247 ._M_iterator(*
this));
248 *_M_stream << __value;
250 *_M_stream << _M_string;
256 operator*() _GLIBCXX_NOEXCEPT
260 operator++() _GLIBCXX_NOEXCEPT
264 operator++(
int) _GLIBCXX_NOEXCEPT
267 #pragma GCC diagnostic pop
271 _GLIBCXX_END_NAMESPACE_VERSION