C++ Logo

std-proposals

Advanced search

Re: [std-proposals] consteval hashing of compile-time constant compound literals

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Fri, 17 May 2024 10:17:11 +0100
On Fri, May 17, 2024 at 10:11 AM Frederick Virchanza Gotham wrote:
>
> which would mean that you can do the following in a consteval context:
>
> std::bit_cast< std::array<char unsigned, sizeof(my_tuple)> >( my_tuple );


Like this:

    https://godbolt.org/z/6qP4x3Wf5

At the top of the GodBolt, you can change the "#if 1" to "#if 0" to
see how it fails with the original 'tuple'.

Received on 2024-05-17 09:17:24