C++ Logo

std-proposals

Advanced search

Re: [std-proposals] TBAA and extended floating-point types

From: Paul Caprioli <paul_at_[hidden]>
Date: Tue, 26 Aug 2025 22:53:48 +0000
Following up to my own email: > The C++ standard does NOT allow one of double or std::float64_t to be a typedef of the other. > I don't have a clear understanding of why this choice was made. P1467R9 says the strongest argument against allowing aliasing [in the sense of typedef] of standard types is to allow overload sets such as: int get_exponent(double x) { /* ... */ } int get_exponent(std::float64_t x) { /* ... */ } Note that allowing aliasing in the sense of making another exception to the strict aliasing rule so as to allow reinterpret_cast would not affect overload resolution.

Received on 2025-08-26 22:53:50