Justin Lebar <justin.lebar@xxxxxxxxx> writes: > I'm surprised that everyone here is in agreement that the code I > posted obeys the strict aliasing rules. My understanding -- and > perhaps this is totally wrong -- is that the "may alias" relation > isn't transitive. That is, although char* may alias anything, T* may > not alias char*. Perhaps this explains the error I'm getting. It's valid because the C++ aliasing rules are not the same as the C aliasing rules. In C++, if you use placement new, it changes the dynamic type of the memory location. The memory location must then be accessed using that type, until a new placement new is run, or the memory is modified using the original type. Ian