Created on 2017-02-03.00:00:00 last changed 89 months ago
Proposed resolution:
This wording is relative to N4618.
Modify [istream.iterator] as indicated:
-1- The class template
istream_iterator
is an input iterator (24.2.3) that reads (usingoperator>>
) successive elements from the input stream for which it was constructed. After it is constructed, and every time++
is used, the iterator reads and stores a value ofT
. If the iterator fails to read and store a value ofT
(fail()
on the stream returnstrue
), the iterator becomes equal to the end-of-stream iterator value. The constructor with no argumentsistream_iterator()
always constructs an end-of-stream input iterator object, which is the only legitimate iterator to be used for the end condition. The result ofoperator*
on an end-of-stream iterator is not defined. For any other iterator value aconst T&
is returned. The result ofoperator->
on an end-of-stream iterator is not defined. For any other iterator value aconst T*
is returned. The behavior of a program that appliesoperator++()
to an end-of-stream iterator is undefined. It is impossible to store things into istream iterators. The typeT
shall meet theDefaultConstructible
,CopyConstructible
, andCopyAssignable
requirements.
[ Kona 2017-03-02 ]
Accepted as Immediate to resolve NB comment.
[ Kona 2017-02-28: Jonathan provides updated wording as requested by LWG. ]
Addresses US 153
istream_iterator default constructor requires a DefaultConstructible T.
Proposed change:
Add a new p1:
Requires: T is DefaultConstructible.
Previous resolution [SUPERSEDED]:
This wording is relative to N4618.
Modify [istream.iterator.cons] as indicated:
see below istream_iterator();-?- Requires: T is DefaultConstructible.
-1- Effects: Constructs the end-of-stream iterator. If is_trivially_default_constructible_v<T> is true, then this constructor is a constexpr constructor. -2- Postconditions: in_stream == 0.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2017-03-05 23:46:08 | admin | set | status: immediate -> wp |
2017-03-03 22:19:58 | admin | set | messages: + msg9073 |
2017-03-03 22:19:58 | admin | set | status: new -> immediate |
2017-03-01 06:47:48 | admin | set | messages: + msg9020 |
2017-02-03 21:37:02 | admin | set | messages: + msg8869 |
2017-02-03 00:00:00 | admin | create |