cast: bit_cast should be constexpr
This commit is contained in:
parent
498da9491b
commit
1dd516d1ed
2
cast.hpp
2
cast.hpp
@ -223,7 +223,7 @@ namespace cruft::cast {
|
|||||||
/// CXX#20: Convert instances of me to std::bit_cast when it becomes
|
/// CXX#20: Convert instances of me to std::bit_cast when it becomes
|
||||||
/// available in supported compilers.
|
/// available in supported compilers.
|
||||||
template <typename DstT, typename SrcT>
|
template <typename DstT, typename SrcT>
|
||||||
DstT
|
constexpr DstT
|
||||||
bit (SrcT &&src)
|
bit (SrcT &&src)
|
||||||
{
|
{
|
||||||
static_assert (sizeof (DstT) == sizeof (SrcT));
|
static_assert (sizeof (DstT) == sizeof (SrcT));
|
||||||
|
Loading…
Reference in New Issue
Block a user