[istream.iterator.cons] (original) (raw)

24 Iterators library [iterators]

24.6 Stream iterators [stream.iterators]

24.6.2 Class template istream_iterator [istream.iterator]

24.6.2.2 Constructors and destructor [istream.iterator.cons]

constexpr istream_iterator();constexpr istream_iterator(default_sentinel_t);

Effects: Constructs the end-of-stream iterator, value-initializing value.

Postconditions: in_stream == nullptr is true.

Remarks: If the initializer T() in the declaration auto x = T();is a constant initializer ([expr.const]), then these constructors are constexpr constructors.

istream_iterator(istream_type& s);

Effects: Initializes in_stream with addressof(s), value-initializes value, and then calls operator++().

constexpr istream_iterator(const istream_iterator& x) noexcept(_see below_);

Effects: Initializes in_stream with x.in_stream and initializes value with x.value.

Remarks: An invocation of this constructor may be used in a core constant expression if and only if the initialization of value from x.valueis a constant subexpression ([defns.const.subexpr]).

The exception specification is equivalent tois_nothrow_copy_constructible_v<T>.

~istream_iterator() = default;

Remarks: If is_trivially_destructible_v<T> is true, then this destructor is trivial.