C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] Allowing access to object representations
From: Timur Doumler (cpp_at_[hidden])
Date: 2019-08-22 07:42:07


If this is indeed what the standard says (you are accessing the "whole object" through that char pointer, and there is no way to get to the bytes) — and I can see how you and language lawyer arrived at this interpretation of the wording, as there is indeed no char object — then frankly, I believe the standard says nonsense. This behaviour is not useful (imho), and no compiler I am aware of implements it that way.

This is a defect in the object model wording that needs fixing.

Cheers,
Timur

> On 22 Aug 2019, at 14:34, sdkrystian via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> Jake, you're thinking about it the wrong way. There exists no char object to bind to. None. The standard does not provide any way for you to do so. What language-lawyer and I have been writing are directly what the standard says. The standard says nothing about it binding to the first byte or any nonsense like that, it explicitly states that it will still point to the original object, no question about it, and the indirection operator will unambiguously yield the original object.
>
> It does not matter what cppreference says, this is what the standard says. It might not be intended, but this is currently how it works.
>
>
>
> Sent from my Samsung Galaxy smartphone.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals



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

Standard Proposals Archives on Google Groups