You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
except that if the object is a union member or subobject thereof, its lifetime only begins if that union member is the initialized member in the union ([dcl.init.aggr], [class.base.init]), or as described in [class.union] and [class.copy.ctor], and except as described in [allocator.members].
[class.copy.assign] p13 explicitly states
If the source and destination of the assignment are not the same object, then for each object nested within ([intro.object]) the object that is the source of the copy, a corresponding object o nested within the destination is created, and the lifetime of o begins before the copy is performed.
So, [basic.life] p1 should be: or as described in [class.union], [class.copy.ctor], and [class.copy.assign].
Incidentally, I think [basic.life] should cover the complete story regards of when/how the lifetime of an object will be begun, as its subject is regarding lifetime. For instance, these operations are phrased as implicitly creating objects, which can also start the lifetimes for objects.
The text was updated successfully, but these errors were encountered:
xmh0511
changed the title
[basic.life] p1 omite a cross-reference to [class.copy.assign] for union member case
[basic.life] p1 omites a cross-reference to [class.copy.assign] for union member case
Jan 21, 2022
jensmaurer
changed the title
[basic.life] p1 omites a cross-reference to [class.copy.assign] for union member case
[basic.life] p1 omits a cross-reference to [class.copy.assign] for union member case
Jan 21, 2022
[class.copy.assign] p13 explicitly states
So, [basic.life] p1 should be: or as described in [class.union], [class.copy.ctor], and [class.copy.assign].
Incidentally, I think [basic.life] should cover the complete story regards of when/how the lifetime of an object will be begun, as its subject is regarding lifetime. For instance, these operations are phrased as implicitly creating objects, which can also start the lifetimes for objects.
The text was updated successfully, but these errors were encountered: