Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[array.overview] Update exceptions to account for changes in #4460 #4744

Merged
merged 2 commits into from Mar 17, 2022

Conversation

JohelEGP
Copy link
Contributor

No description provided.

@JohelEGP
Copy link
Contributor Author

source/containers.tex Outdated Show resolved Hide resolved
@JohelEGP JohelEGP changed the title [array.overview] Extend complexity exception to move construction [array.overview] Make a note of the complexity exceptions in the iref Jul 28, 2021
@wg21bot wg21bot added the needs rebase The pull request needs a git rebase to resolve merge conflicts. label Feb 6, 2022
@jensmaurer
Copy link
Member

#4460 has landed.

@JohelEGP
Copy link
Contributor Author

JohelEGP commented Feb 6, 2022

There's 2 things to do:

  • Mention the default constructor for array exception in the container requirements.
  • Mention the move construction exception in array's introduction.

I don't see a need to use notes anymore.

@JohelEGP
Copy link
Contributor Author

Let me amend that.


  • Mention the move construction exception in array's introduction.

This is already present:

16
#
Complexity: Linear for array and constant for all other standard containers.


array's intro says:

3
#
An array meets all of the requirements of a container ([container.reqmts]) and of a reversible container ([container.rev.reqmts]), except that a default constructed array object is not empty and that swap does not have constant complexity.

swap, which is already specified as

47
#
Complexity: Linear for array and constant for all other standard containers.

shouldn't be part of this "except that", since its rightfully part of the container requirements.

A default constructed array object is not always empty. That depends on N. This should be fixed. For simplicity, I plan to keep the "except that" and leave the default constructor container requirements untouched. The reason for this is that it's more incremental and easier to get accepted, as well that all other array exceptions lie in Complexity elements, as well that we'd have to talk about N, which we'd need to introduce, and its specification as a container requirement would be much longer than the existing exceptions for array's complexities.

The container requirements already describe this behavior,
so from the POV of this subclause, there's no exception.
@JohelEGP JohelEGP changed the title [array.overview] Make a note of the complexity exceptions in the iref [array.overview] Update exceptions to account for changes in #4460 Feb 21, 2022
source/containers.tex Outdated Show resolved Hide resolved
@jensmaurer
Copy link
Member

@jwakely, this boils down to removing redundant specification (swap complexity) and fixing bad specification (zero-sized arrays are, in fact, empty).

@jensmaurer jensmaurer removed the needs rebase The pull request needs a git rebase to resolve merge conflicts. label Mar 2, 2022
@tkoeppe tkoeppe merged commit 65e7438 into cplusplus:main Mar 17, 2022
@JohelEGP JohelEGP deleted the array.overview branch March 17, 2022 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants