What's the correct way to write the code below?
I have a memory manager which provides me with char *'s, but I need to work with arrays of uint32_t. How can I work around the strict aliasing rule? I understand that with a single object it's advised just to copy the contents with memcpy() but that solution is not acceptable for an array of objects.
char* ptr = manager()->Allocate(1000 * sizeof(uint32_));
uint32_t* u32ptr = reinterpret_cast<uint32_t*>(ptr);
....
u32ptr[x] = y;