copying an object of non-trivial type error
This commit is contained in:
parent
c4ee726532
commit
5d7366e37b
@ -287,7 +287,8 @@ FMT_CONSTEXPR20 auto bit_cast(const From& from) -> To {
|
||||
if (is_constant_evaluated()) return std::bit_cast<To>(from);
|
||||
#endif
|
||||
auto to = To();
|
||||
std::memcpy(&to, &from, sizeof(to));
|
||||
std::memcpy(static_cast<void*>(&to), static_cast<const void*>(&from),
|
||||
sizeof(to));
|
||||
return to;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user