30 #ifndef _STREAM_ITERATOR_H
31 #define _STREAM_ITERATOR_H 1
33 #pragma GCC system_header
37 namespace std _GLIBCXX_VISIBILITY(default)
39 _GLIBCXX_BEGIN_NAMESPACE_VERSION
47 #pragma GCC diagnostic push
48 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
51 template<
typename _Tp,
typename _CharT = char,
52 typename _Traits = char_traits<_CharT>,
typename _Dist = ptrdiff_t>
54 :
public iterator<input_iterator_tag, _Tp, _Dist, const _Tp*, const _Tp&>
57 typedef _CharT char_type;
58 typedef _Traits traits_type;
73 : _M_stream(0), _M_value(), _M_ok(false) {}
83 : _M_stream(__obj._M_stream), _M_value(__obj._M_value),
87 #if __cplusplus > 201703L && __cpp_lib_concepts
90 noexcept(is_nothrow_default_constructible_v<_Tp>)
94 #if __cplusplus >= 201103L
101 operator*() const _GLIBCXX_NOEXCEPT
103 __glibcxx_requires_cond(_M_ok,
104 _M_message(__gnu_debug::__msg_deref_istream)
105 ._M_iterator(*
this));
111 operator->() const _GLIBCXX_NOEXCEPT
117 __glibcxx_requires_cond(_M_ok,
118 _M_message(__gnu_debug::__msg_inc_istream)
119 ._M_iterator(*
this));
127 __glibcxx_requires_cond(_M_ok,
128 _M_message(__gnu_debug::__msg_inc_istream)
129 ._M_iterator(*
this));
141 return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream);
147 if (_M_stream && !(*_M_stream >> _M_value))
160 {
return __x._M_equal(__y); }
162 #if __cpp_impl_three_way_comparison < 201907L
169 {
return !__x._M_equal(__y); }
172 #if __cplusplus > 201703L && __cpp_lib_concepts
176 {
return !__i._M_stream; }
191 template<
typename _Tp,
typename _CharT = char,
192 typename _Traits = char_traits<_CharT> >
194 :
public iterator<output_iterator_tag, void, void, void, void>
199 #if __cplusplus > 201703L
209 const _CharT* _M_string;
231 : _M_stream(__obj._M_stream), _M_string(__obj._M_string) { }
233 #if __cplusplus >= 201103L
242 __glibcxx_requires_cond(_M_stream != 0,
243 _M_message(__gnu_debug::__msg_output_ostream)
244 ._M_iterator(*
this));
245 *_M_stream << __value;
247 *_M_stream << _M_string;
253 operator*() _GLIBCXX_NOEXCEPT
257 operator++() _GLIBCXX_NOEXCEPT
261 operator++(
int) _GLIBCXX_NOEXCEPT
264 #pragma GCC diagnostic pop
268 _GLIBCXX_END_NAMESPACE_VERSION