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

3297. Useless sequence container requirement

Section: 23.2.4 [sequence.reqmts] Status: New Submitter: Casey Carter Opened: 2019-09-17 Last modified: 2022-04-24

Priority: 3

View other active issues in [sequence.reqmts].

View all other issues in [sequence.reqmts].

View all issues with New status.

Discussion:

23.2.4 [sequence.reqmts] paragraph 3 says that the names i and j denote "iterators that meet the Cpp17InputIterator requirements and refer to elements implicitly convertible to value_type". Ignoring for the moment that this is an occurrence of LWG 3105(i) — we really mean that *i and *j must be implicitly convertible to value_type — this requirement seems to be completely extraneous.

The names i and j are used in three places in the requirements table:

We should strike the implicit conversion requirement since it is not useful and only serves to confuse readers of the Standard (see e.g. here).

[2019-10-31 Issue Prioritization]

Priority to 3 after reflector discussion.

Previous resolution [SUPERSEDED]:

This wording is relative to N4830.

  1. Modify 23.2.4 [sequence.reqmts] as indicated:

    -3- In Tables 76 and 77, X denotes a sequence container class, a denotes a value of type X containing elements of type T, u denotes the name of a variable being declared, A denotes X::allocator_type if the qualified-id X::allocator_type is valid and denotes a type (13.10.3 [temp.deduct]) and allocator<T> if it doesn't, i and j denote iterators that meet the Cpp17InputIterator requirements and refer to elements implicitly convertible to value_type, [i, j) denotes a valid range, […]

[2022-04-24; Daniel rebases wording on N4910]

Proposed resolution:

This wording is relative to N4910.

  1. Modify 23.2.4 [sequence.reqmts] as indicated:

    -3- In this subclause,

    1. (3.1) — […]

    2. […]

    3. (3.5) — i and j denote iterators that meet the Cpp17InputIterator requirements and refer to elements implicitly convertible to value_type,

    4. […]