Repository navigation
LWG-617: [sequences.general] <array> claimed to define a template meeting sequence container requirements #5916
Description
Activity
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.
hubert-reinterpretcast commented
on Oct 25, 2022 MemberAuthorMore actionsJust 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,
arrayis a sequence container.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?
hubert-reinterpretcast commented
on Oct 25, 2022 MemberAuthorMore actionsThis 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?
An array meets some of the requirements of a sequence container.
So [array.overview]p3 disagrees with [sequences.general]p1 and [sequence.reqmts]p1.
Meeting some of the requirements does not preclude meeting all of the requirements.
According to [sequence.reqmts]p5,
arraydoes 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.array<T, N>forN > 0doesn't meet [container.reqmts]/10, so many specializations ofarrayare 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
arraybe a sequence container by changing the requirements rather than yanking all the wording that suggestsarrayis a sequence container.)This was LWG-617, which I believe was incorrectly resolved NAD.
Reacted by A. JiangThis was LWG-617, which I believe was incorrectly resolved NAD.
And now it has been reopened.
- 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
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.