On Aug 18, 2022, at 5:26 AM, Andrey Semashev via Boost
wrote: On 8/18/22 13:13, John Maddock via Boost wrote:
On 18/08/2022 07:23, Mathias Gaunard via Boost wrote:
bit_cast is constexpr.
Good catch!
Matt and I discussed this ages ago and decided it was basically impossible, it's a shame that fix is C++20 but it's certainly better than nothing.
__builtin_bit_cast is available regardless of the C++ level. Though you're still limited to compilers that support it.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Using __builtin_bit_cast should be fine for conditional C++17 support since we already rely on __builtin_is_constant_evaluated. I’ll play with it this weekend and see where it get us. Worst case is we static_assert unsupported cases like John suggested. Matt