Fix potential alignment bug

This commit is contained in:
Maxime Coste 2014-11-05 13:50:06 +00:00
parent 0d620c3905
commit a3b29b1f11

View File

@ -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;