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

A subobject is contained by another object rather than by a type #5339

Open
xmh0511 opened this issue Mar 10, 2022 · 0 comments · May be fixed by #6425
Open

A subobject is contained by another object rather than by a type #5339

xmh0511 opened this issue Mar 10, 2022 · 0 comments · May be fixed by #6425

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Mar 10, 2022

[class.compare.default] p6 states that:

The direct base class subobjects of C, in the order of their declaration in the base-specifier-list of C, followed by the non-static data members of C, in the order of their declaration in the member-specification of C, form a list of subobjects.

Presumably, C is inferred to denote a class type from the context of this sentence. However, a "subobject" is defined for the relationship between two objects. It does not make sense to say the subobject of a type.

The improvement may be that:

The direct base class subobjects of an object x of class type C, in the order of their types specified in the base-specifier-list of C, followed by the direct non-static data member subobjects of x, in the order of their declaration in the member-specification of C, form a list of subobjects for x.

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 a pull request may close this issue.

1 participant