C++ Logo

std-proposals

Advanced search

Re: Allowing access to object representations

From: Language Lawyer <language.lawyer_at_[hidden]>
Date: Sat, 17 Aug 2019 16:57:50 +0300
Hi,

I've looked at the proposed wording and what are you trying to add seem to be at odds with [intro.object]/8 in C++17 ([intro.object]/9 in the current draft):
> Two objects a and b with overlapping lifetimes that are not bit-fields may have the same address if one is nested within the other, or if at least one is a base class subobject of zero size and they are of different types; otherwise, they have distinct addresses

In your proposal,
> The lifetime of the elements of the object representation of an object begins when the lifetime of the object begins and ends when the lifetime of the object ends.

This sounds like an object and the first element of its object representation have overlapping lifetimes and have the same address, but there is no "nested within" (or any other permitted) relation between them.

Received on 2019-08-17 08:59:53