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