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

[dcl.stc] Define mutable subobject and make use of keyword consistent #3901

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sdkrystian
Copy link
Contributor

We use the term "mutable subobject" to refer to objects corresponding to members declared mutable, but we don't define this anywhere. This defines it in [dcl.stc], and additionally changes adds \tcode to "mutable" when referring to a member declared mutable, since it's a keyword in those contexts (this is used for the majority of references to members declared mutable).

@jensmaurer
Copy link
Member

Please use \keyword, not \tcode, when referring to keywords. That also helps the index.

source/declarations.tex Outdated Show resolved Hide resolved
@@ -6938,7 +6938,7 @@
\item
an invocation of an implicitly-defined copy/move constructor or
copy/move assignment operator
for a union whose active member (if any) is mutable,
for a union whose active member (if any) is \keyword{mutable},
Copy link
Member

Choose a reason for hiding this comment

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

We say "const" (no special decoration), so I think we shouldn't make this case a \keyword. Unless we say "declared \keword{mutable}" or so.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The motivation for this was to keep the distinction between objects and members (i,e. a mutable member corresponds to a mutable subobject).

Copy link
Member

@jensmaurer jensmaurer left a comment

Choose a reason for hiding this comment

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

My view: Take the first change (\keyword + definition of "mutable subobject") and leave the rest alone.

Comment on lines +485 to +486
A member subobject\iref{intro.object} corresponding to a non-static
data member declared with the \keyword{mutable} specifier is a \defnadj{mutable}{subobject}.
Copy link
Member

Choose a reason for hiding this comment

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

Should "mutable subobject" be transitive? That is, should a (non-const) subobject of a mutable subobject also be a mutable subobject? The use of "mutable subobject" in [basic.type.qualifier]/1.1 in the definition of "const object" appears to assume transitivity -- but maybe it means "or a non-mutable direct subobject of a const object"

@zygoloid
Copy link
Member

I would prefer that we define what it means for a non-static data member to be "mutable" (no \keyword) rather than talking about \keyword{mutable} members.

@zygoloid zygoloid added the changes requested Changes to the wording or approach have been requested and not yet applied. label Oct 18, 2020
@wg21bot wg21bot added the needs rebase The pull request needs a git rebase to resolve merge conflicts. label Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes requested Changes to the wording or approach have been requested and not yet applied. needs rebase The pull request needs a git rebase to resolve merge conflicts.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants