C++ Logo

std-proposals

Advanced search

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

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Fri, 16 Jan 2026 16:44:29 +0100
A new function (instead of bit_cast) would be needed, if one wants to do that. -----Ursprüngliche Nachricht----- Von:Jan Schultke <janschultke_at_[hidden]> Gesendet:Fr 16.01.2026 16:35 Betreff:Re: [std-proposals] Fixing std::bit_cast padding bit issues An:std-proposals_at_[hidden]; CC:Sebastian Wittmeier <wittmeier_at_[hidden]>; 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 16:00:30