C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Fixing std::bit_cast padding bit issues

From: Jan Schultke <janschultke_at_[hidden]>
Date: Fri, 16 Jan 2026 16:34:37 +0100
> I think the only solution is to create or use wider types, where the
> padding bits are part of the value representation.
>

How does that fix the problem of bit-casting long double to __int128? If
the destination type was wider, you couldn't bit-cast (constraints not
satisfied). The destination type has no padding bits, yet the cast is an
alternative spelling for std::unreachable().

Received on 2026-01-16 15:34:53