
13 Mar
2009
13 Mar
'09
1:22 p.m.
It's my understanding that static_casting the result of malloc is well defined behaviour, whereas using reinterpret_cast isn't.
Casting from void* to T* (or X* to Y*) is precisely when I'd use reinterpret_cast (and, indeed, it's not much use for anything else).
Because the result of a reinterpret_cast is implementation defined, it's only really useful when writing code that has implementation defined results by neccessity (endian handling code for example).