C++ Logo


Advanced search

Subject: Re: [std-proposals] Allowing access to object representations
From: Language Lawyer (language.lawyer_at_[hidden])
Date: 2019-08-17 08:57:50


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.

STD-PROPOSALS list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups