Here is the C++11 way of specifying alignment :
alignas(T) char buffer[sizeof(T)];
Or better still, just use the unrestricted union feature : union {
T t;
};
Just use &t in place of buffer.