diff --git a/include/etl/_bit/bit_cast.hpp b/include/etl/_bit/bit_cast.hpp index b3cdf6498..f5c19a942 100644 --- a/include/etl/_bit/bit_cast.hpp +++ b/include/etl/_bit/bit_cast.hpp @@ -41,15 +41,11 @@ template requires(detail::bit_castable_types) constexpr auto bit_cast(From const& src) noexcept -> To { -#if __has_builtin(__builtin_bit_cast) +#if __has_builtin(__builtin_bit_cast) or (defined(_MSC_VER) and not defined(__clang__)) return __builtin_bit_cast(To, src); #else - // This implementation additionally requires destination type to be - // trivially constructible - static_assert(is_trivially_constructible_v); - To dst{}; - detail::memcpy(&dst, &src, sizeof(To)); + etl::detail::memcpy(&dst, &src, sizeof(To)); return dst; #endif }