3203. span element access invalidation

Section: 23.7.2.2.1 [span.overview] Status: WP Submitter: Johel Ernesto Guerrero Peña Opened: 2019-05-04 Last modified: 2023-11-22

Priority: 2

View all other issues in [span.overview].

View all issues with WP status.

Discussion:

span doesn't explicitly point out when its accessed elements are invalidated like string_view does in 27.3.3.4 [string.view.iterators] p2.

[2019-06-12 Priority set to 2 after reflector discussion]

Previous resolution [SUPERSEDED]:

This wording is relative to N4910.

  1. Modify 23.7.2.2.1 [span.overview] as indicated:

    -4- ElementType is required to be a complete object type that is not an abstract class type.

    -?- For a span s, any operation that invalidates a pointer in the range [s.data(), s.data() + s.size()) invalidates pointers, iterators, and references other than *this returned from s's member functions.

[2023-06-13; Varna]

The reference to N4910 27.3.3.4 [string.view.iterators] p2 is located now in N4950 27.3.3.1 [string.view.template.general] p2 where its says:

For a basic_string_view str, any operation that invalidates a pointer in the range

[str.data(), str.data() + str.size())

invalidates pointers, iterators, and references returned from str's member functions.

The group also suggested to adjust 27.3.3.1 [string.view.template.general] p2 similarly.

[2023-06-14 Varna; Move to Ready]

[2023-11-11 Approved at November 2023 meeting in Kona. Status changed: Voting → WP.]

Proposed resolution:

This wording is relative to N4950.

  1. Modify 27.3.3.1 [string.view.template.general] as indicated:

    [Drafting note: The proposed wording also removes the extra code block that previously defined the range]

    -2- For a basic_string_view str, any operation that invalidates a pointer in the range [str.data(), str.data() + str.size()) invalidates pointers, iterators, and references to elements of strreturned from str's member functions.

  2. Modify 23.7.2.2.1 [span.overview] as indicated:

    -4- ElementType is required to be a complete object type that is not an abstract class type.

    -?- For a span s, any operation that invalidates a pointer in the range [s.data(), s.data() + s.size()) invalidates pointers, iterators, and references to elements of s.