Skip to content

[class.copy.ctor][class.copy.assign] Tweak style and indexing for copy/move constructors and assignment operators, remove "user-declared"#8195

Open
frederick-vs-ja wants to merge 2 commits into
cplusplus:mainfrom
frederick-vs-ja:italic-copy-move-fn
Open

[class.copy.ctor][class.copy.assign] Tweak style and indexing for copy/move constructors and assignment operators, remove "user-declared"#8195
frederick-vs-ja wants to merge 2 commits into
cplusplus:mainfrom
frederick-vs-ja:italic-copy-move-fn

Conversation

@frederick-vs-ja

Copy link
Copy Markdown
Contributor

Terms copy constructor, move constructor, copy assignment operator, and move assignment operator should be italicized as a whole. \defnadj seems appropriate for this.

Some \indextext seem attached to wrong paragraphs, so this PR moves them.

It's probably superfluous to say "user-declared" as the implicitly declared ones are arguably left uncovered.

Fixes #556.

Comment thread source/classes.tex
Comment on lines +1871 to 1872
A \defnadj{move}{assignment operator} \tcode{X::operator=} is
a non-static non-template member function of class \tcode{X} with exactly

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like that for copy constructors, X is first introduced as

A non-template constructor for class X

... but down here, it's phrased as

... is a non-static non-template member function of class X

Surely, we can make the wording for all these special member functions more symmetrical, and be more consistent about whether X or X::operator= is introduced first.

It also feels a bit redundant that we need to state that operator= is a non-static member function. Shouldn't that be obvious from its code spelling?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're also inconsistent about "for class" vs. "of class".

@jensmaurer jensmaurer Aug 30, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're inconsistent about a lot of things across the standard. The present pull request seems like a pure indexing improvement and thus can be reviewed/applied a lot quicker than changes beyond that. Don't do that here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be fair, it's not just a pure indexing change. The PR also removes the term "user-declared" from wording. I wouldn't have said anything if that wasn't the case. I can live with the consistency tweaks being done separately though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removal of "user-declared" was planned for discussion in 2017 (#556 (comment)). I think this can be applied together (otherwise we might need another issue for it).

Comment thread source/classes.tex
@eisenwave eisenwave added the P2-Bug Presentational errors and omissions label Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2-Bug Presentational errors and omissions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Format in [class.copy]/17

3 participants