cast: bit_cast should be constexpr

This commit is contained in:
Danny Robson 2022-02-07 12:14:06 +10:00
parent 498da9491b
commit 1dd516d1ed

View File

@ -223,7 +223,7 @@ namespace cruft::cast {
/// CXX#20: Convert instances of me to std::bit_cast when it becomes
/// available in supported compilers.
template <typename DstT, typename SrcT>
DstT
constexpr DstT
bit (SrcT &&src)
{
static_assert (sizeof (DstT) == sizeof (SrcT));