This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.

2804. Unconditional constexpr default constructor for istream_iterator

Section: [istream.iterator.cons] Status: C++17 Submitter: United States Opened: 2016-11-09 Last modified: 2017-08-01

Priority: 0

View all other issues in [istream.iterator.cons].

View all issues with C++17 status.


Addresses US 152

see below for the default constructor should simply be spelled constexpr. The current declaration looks like a member function, not a constructor, and the constexpr keyword implicitly does not apply unless the instantiation could make it so, under the guarantees al ready present in the Effects clause.

Proposed change:

Replace see below with constexpr in the declaration of the default constructor for istream_iterator in the class definition, and function specification.

[Issues Telecon 16-Dec-2016]

Jonathan provides wording, Move to Tentatively Ready

Proposed resolution:

In the class synopsis in 24.6.1 [istream.iterator] change the default constructor:

see belowconstexpr istream_iterator();
istream_iterator(istream_type& s);
istream_iterator(const istream_iterator& x) = default;
~istream_iterator() = default;

Change [istream.iterator.cons] before paragraph 1:

see belowconstexpr istream_iterator();

-1- Effects: ...