diff --git a/include/fmt/format.h b/include/fmt/format.h index 0bd2fdb1..34da562f 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -287,7 +287,8 @@ FMT_CONSTEXPR20 auto bit_cast(const From& from) -> To { if (is_constant_evaluated()) return std::bit_cast(from); #endif auto to = To(); - std::memcpy(&to, &from, sizeof(to)); + std::memcpy(static_cast(&to), static_cast(&from), + sizeof(to)); return to; }