Fix potential alignment bug
This commit is contained in:
parent
0d620c3905
commit
a3b29b1f11
|
@ -151,7 +151,7 @@ T read(int socket)
|
|||
union U
|
||||
{
|
||||
T object;
|
||||
char data[sizeof(T)];
|
||||
alignas(T) char data[sizeof(T)];
|
||||
U() {}
|
||||
~U() { object.~T(); }
|
||||
} u;
|
||||
|
|
Loading…
Reference in New Issue
Block a user