Skip to content

LWG-617: [sequences.general] <array> claimed to define a template meeting sequence container requirements #5916

Description

@hubert-reinterpretcast

This is now LWG-617.

[sequences.general] paragraph 1 claims that <array> is one of various headers that define class templates that meet the requirements for sequence containers.

<array> does not define such a template.

Activity

  1. JohelEGP commented on Oct 25, 2022

    @JohelEGP
    Contributor

    Why not? Reading [sequence.reqmts], it seems the intent is for it to be one, which means this is not editorial:

    In addition, array is provided as a sequence container which provides limited sequence operations because it has a fixed number of elements.

  2. hubert-reinterpretcast commented on Oct 25, 2022

    @hubert-reinterpretcast
    MemberAuthor

    Just before the part you quoted, we have:

    The library provides four basic kinds of sequence containers: vector, forward_list, list, and deque.

    Thus, in context, the sentence you quoted is saying that, except for specific reasons why it isn't, array is a sequence container.

  3. JohelEGP commented on Oct 25, 2022

    @JohelEGP
    Contributor

    except for specific reasons why it isn't

    This formulation seems wrong, because it is, according to the wording. Can you show a requirement it fails to meet?

  4. hubert-reinterpretcast commented on Oct 25, 2022

    @hubert-reinterpretcast
    MemberAuthor

    This formulation seems wrong, because it is, according to the wording. Can you show a requirement it fails to meet?

    Just read [array.overview] paragraph 3?

  5. JohelEGP commented on Oct 26, 2022

    @JohelEGP
    Contributor

    An array meets some of the requirements of a sequence container.

    So [array.overview]p3 disagrees with [sequences.general]p1 and [sequence.reqmts]p1.

  6. CaseyCarter commented on Oct 26, 2022

    @CaseyCarter
    Contributor

    Meeting some of the requirements does not preclude meeting all of the requirements.

  7. JohelEGP commented on Oct 26, 2022

    @JohelEGP
    Contributor

    According to [sequence.reqmts]p5, array does not meet the sequence container requirements. It can't meet the initialization requirements just after it.

    5
    #
    A type X meets the sequence container requirements if X meets the container requirements and the following statements and expressions are well-formed and have the specified semantics.

    So only [sequences.general]p1 is wrong:

    1
    #
    The headers , , <forward_­list>, , and define class templates that meet the requirements for sequence containers.

  8. CaseyCarter commented on Oct 26, 2022

    @CaseyCarter
    Contributor

    array<T, N> for N > 0 doesn't meet [container.reqmts]/10, so many specializations of array are neither containers nor contiguous containers, which means [array.overview]/1 and /3 are contradictory as well.

    I don't think we can fix this all editorially, this probably deserves an LWG issue. (I think we probably want to make array be a sequence container by changing the requirements rather than yanking all the wording that suggests array is a sequence container.)

  9. CaseyCarter commented on Oct 26, 2022

    @CaseyCarter
    Contributor

    This was LWG-617, which I believe was incorrectly resolved NAD.

  10. JohelEGP commented on Oct 29, 2022

    @JohelEGP
    Contributor

    This was LWG-617, which I believe was incorrectly resolved NAD.

    And now it has been reopened.

  11. changed the title [-][sequences.general] <array> claimed to define a template meeting sequence container requirements[/-] [+]LWG-617: [sequences.general] <array> claimed to define a template meeting sequence container requirements[/+] on Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions