C++ Logo

std-proposals

Advanced search

Re: Allowing access to object representations

From: Jake Arkinstall <jake.arkinstall_at_[hidden]>
Date: Sat, 24 Aug 2019 10:55:25 +0100
I see (or at least I think I do).

In which case, the standard is not just badly worded, it is completely
unimplementable. Once it is reinterpret casted to a char pointer and passed
to a function that treats it as a char pointer (particularly a function
that is already compiled and has no knowledge of the context), it's going
to use the leftmost byte. Unless it's at the reinterpret cast where it's
decided that the char pointer has a different address to the int pointer.
I'm not sure. Standardese is confusing at the best of times, let alone when
it contradicts fundamentals (and a total of millions of lines worth of
perfectly working low level code). If the idea is to make C more
attractive, it's working.

The idea that the binary is the representation and "the object" is
fundamental is at odds with reality. The compilation process, for example,
treats the object as the representation and the binary as fundamental.


On Thu, 22 Aug 2019, 13:35 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
>

Received on 2019-08-24 04:57:39