C++ Logo

std-proposals

Advanced search

Re: [std-proposals] [Draft Proposal] Required attribute syntax

From: Thiago Macieira <thiago_at_[hidden]>
Date: Thu, 04 May 2023 12:13:30 -0700
On Thursday, 4 May 2023 08:15:26 PDT Jason McKesson via Std-Proposals wrote:
> This rule creates chaos when it comes to defining when a subobject can
> be zero-sized, as I outline here:
> https://github.com/NicolBolas/Proposal-Ideas/blob/main/Stateless%20Subobject
> s.md#unique-identity-problem-identity About a third of the text in that
> proposal is dedicated to analzying the problem and detailing possible
> solutions, all of which are some form of awful.
>
> If you want to take a crack at that, be my guest, but it's not nearly
> as trivial as you might think. Unless you're going to have the
> standard explicitly spell out layout rules byte-for-byte, unless
> you're just going to standardize the Itanium ABI or something, this is
> going to be incredibly difficult.

I think I argued at the time that the class needs to declare that it can
forego the unique identity rule in the first place.

This would enable a type with two std::allocator (for example) to both share
an address, something they can't do today because of that rule.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-05-04 19:13:32