Date: Sun, 24 Aug 2025 14:37:39 -0400
On Sun, Aug 24, 2025 at 12:31 PM Paul Caprioli via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> > You can reinterpret_cast char8_t* to char* just fine.
>
> But one cannot reinterpret_cast between std::float64_t* and double* (and use the resulting pointer).
The reason that the `char*` cast works is because `char*` gets to be
an exception to aliasing *in general*. It wasn't done to specifically
allow this use case; it's just a happy accident.
> P1467R9 discusses implicit conversions, overload resolution, and adding extended floating-point types to <cmath>.
> It seems the extended floating-point types were intended to be used.
<std-proposals_at_[hidden]> wrote:
>
> > You can reinterpret_cast char8_t* to char* just fine.
>
> But one cannot reinterpret_cast between std::float64_t* and double* (and use the resulting pointer).
The reason that the `char*` cast works is because `char*` gets to be
an exception to aliasing *in general*. It wasn't done to specifically
allow this use case; it's just a happy accident.
> P1467R9 discusses implicit conversions, overload resolution, and adding extended floating-point types to <cmath>.
> It seems the extended floating-point types were intended to be used.
Received on 2025-08-24 18:37:51