-
Notifications
You must be signed in to change notification settings - Fork 786
Description
Also, the term "direct subobject" should be defined and/or [except.ctor]/3 should be fixed.
Richard Smith's answer to 'Is "subobject" a transitive relation?':
I think it depends on the context of the use, sadly. Strictly, subobject is
not transitive, and an object is only a subobject in at most one way (it
cannot be both an array element and a base class subobject, for instance),
notwithstanding that a virtual base class subobject can be a subobject of
multiple objects at once. Most uses of the term seem to use it in that way.However, there are some uses that clearly intend to take the transitive
closure:
- [basic.stc.dynamic.safety]/2.2 intends to allow transitive subobjects
(but should probably allow all objects nested within the original object)- [basic.types]/3's example says "subobject" but presumably means
something more general- [basic.type.qualifier]/1.1, /1.2, /1.3 have ambiguous antecedents and
could be reworded to make it clearer that they are transitive ("of such an
object" -> "of a const object").- [basic.start.static]/2 intends to allow transitive subobjects
- [conv.ptr]/3 intends to allow anything in the transitive closure of
"base class subobject of".
... and so on. (I'm sure you can find more.)Feel like filing an editorial issue? We should aim to use the term
consistently.
From me:
[except.ctor]/3:
If the initialization or destruction of an object other than by delegating constructor is terminated by an exception, the destructor is invoked for each of the object's direct subobjects…
(Implies that subobjects can be indirect)
If the 'direct subobjects' here are '(immediate) base class subobjects' and 'member subobjects', what does it mean for members of an array type? How can a destructor be invoked for them? (Should I create another issue for this?)