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

[deque.modifiers][vector.modifiers] unclear "assignment operator" #3208

Open
FrankHB opened this issue Sep 2, 2019 · 3 comments
Open

[deque.modifiers][vector.modifiers] unclear "assignment operator" #3208

FrankHB opened this issue Sep 2, 2019 · 3 comments
Labels
lwg Issue must be reviewed by LWG.

Comments

@FrankHB
Copy link
Contributor

FrankHB commented Sep 2, 2019

N4830

[deque.modifiers]
5 Complexity: The number of calls to the destructor of T is the same as the number of elements erased, but the number of calls to the assignment operator of T is no more than the lesser of the number of elements before the erased elements and the number of elements after the erased elements.
6 Throws: Nothing unless an exception is thrown by the assignment operator of T.

[vector.modifiers]
4 Complexity: The destructor of T is called the number of times equal to the number of the elements erased, but the assignment operator of T is called the number of times equal to the number of elements in the vector after the erased elements.
5 Throws: Nothing unless an exception is thrown by the assignment operator or move assignment operator of T.

Given the similar intention of these subclauses, the wording should be more consistent. In particular, it is a bit unclear to me that:

  • What is "the assignment operator" in these contexts? Should it be explicit that such an assignment operator requires some specific forms of arguments (e.g. rvalues of type T)?
  • What does "the assignment operator or move assignment operator of T" exactly mean?
@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Sep 2, 2019
@jensmaurer
Copy link
Member

How much of this is editorial?

@FrankHB
Copy link
Contributor Author

FrankHB commented Sep 2, 2019

Editorial IMO:

  • Decide to make [deque.modifiers] and [vector.modifiers] look more similar, or to make the common wording in [container.requirements.general]. (Note they are already mentioned by [container.requirements.general]/11).
  • I believe the intended meaning of "the assignment operator" should exclude assignment operators that are not special member functions, i.e. it could be either the copy assignment operator or the move assignment operator of T when appropriate, depending on T.

Not editorial:

  • Probably better add "Expects: T is ...".
  • In cases when the belief above is actually invalid. (I don't find any real one.)

@jensmaurer jensmaurer added lwg Issue must be reviewed by LWG. and removed decision-required A decision of the editorial group (or the Project Editor) is required. labels Sep 9, 2019
@jensmaurer
Copy link
Member

Editorial teleconference: Substantial parts that LWG needs to look at.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lwg Issue must be reviewed by LWG.
Projects
None yet
Development

No branches or pull requests

2 participants