30#ifndef _STREAM_ITERATOR_H
31#define _STREAM_ITERATOR_H 1
34#pragma GCC system_header
42namespace std _GLIBCXX_VISIBILITY(default)
44_GLIBCXX_BEGIN_NAMESPACE_VERSION
52#pragma GCC diagnostic push
53#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
56 template<
typename _Tp,
typename _CharT = char,
59 :
public iterator<input_iterator_tag, _Tp, _Dist, const _Tp*, const _Tp&>
62 typedef _CharT char_type;
63 typedef _Traits traits_type;
67 istream_type* _M_stream;
78 : _M_stream(0), _M_value(), _M_ok(false) {}
88 : _M_stream(__obj._M_stream), _M_value(__obj._M_value),
92#if __cplusplus > 201703L && __cpp_lib_concepts
95 noexcept(is_nothrow_default_constructible_v<_Tp>)
99#if __cplusplus >= 201103L
106 operator*() const _GLIBCXX_NOEXCEPT
108 __glibcxx_requires_cond(_M_ok,
109 _M_message(__gnu_debug::__msg_deref_istream)
110 ._M_iterator(*
this));
116 operator->() const _GLIBCXX_NOEXCEPT
122 __glibcxx_requires_cond(_M_ok,
123 _M_message(__gnu_debug::__msg_inc_istream)
124 ._M_iterator(*
this));
132 __glibcxx_requires_cond(_M_ok,
133 _M_message(__gnu_debug::__msg_inc_istream)
134 ._M_iterator(*
this));
146 return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream);
152 if (_M_stream && !(*_M_stream >> _M_value))
165 {
return __x._M_equal(__y); }
167#if __cpp_impl_three_way_comparison < 201907L
174 {
return !__x._M_equal(__y); }
177#if __cplusplus > 201703L && __cpp_lib_concepts
181 {
return !__i._M_stream; }
196 template<
typename _Tp,
typename _CharT = char,
199 :
public iterator<output_iterator_tag, void, void, void, void>
204#if __cplusplus > 201703L
214 const _CharT* _M_string;
236 : _M_stream(__obj._M_stream), _M_string(__obj._M_string) { }
238#if __cplusplus >= 201103L
247 __glibcxx_requires_cond(_M_stream != 0,
248 _M_message(__gnu_debug::__msg_output_ostream)
249 ._M_iterator(*
this));
250 *_M_stream << __value;
252 *_M_stream << _M_string;
262 operator++() _GLIBCXX_NOEXCEPT
266 operator++(
int) _GLIBCXX_NOEXCEPT
269#pragma GCC diagnostic pop
273_GLIBCXX_END_NAMESPACE_VERSION
constexpr complex< _Tp > operator*(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x times y.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
ISO C++ entities toplevel namespace is std.
Template class basic_istream.
Template class basic_ostream.
is_nothrow_default_constructible
is_nothrow_copy_constructible
Basis for explicit traits specializations.
Provides input iterator semantics for streams.
istream_iterator(istream_type &__s)
Construct start of input stream iterator.
constexpr istream_iterator() noexcept(/*conditional */)
Construct end of input stream iterator.
friend bool operator==(const istream_iterator &__x, const istream_iterator &__y) noexcept
Return true if the iterators refer to the same stream, or are both at end-of-stream.
Provides output iterator semantics for streams.
_CharT char_type
Public typedef.
ostream_iterator(ostream_type &__s) noexcept
Construct from an ostream.
ostream_iterator(ostream_type &__s, const _CharT *__c) noexcept
_Traits traits_type
Public typedef.
ostream_iterator & operator=(const _Tp &__value)
Writes value to underlying ostream using operator<<. If constructed with delimiter string,...
ptrdiff_t difference_type
Public typedef.
basic_ostream< _CharT, _Traits > ostream_type
Public typedef.
ostream_iterator(const ostream_iterator &__obj) noexcept
Copy constructor.