12 Aug
2010
12 Aug
'10
12:25 a.m.
At Wed, 11 Aug 2010 16:07:31 -0700, Emil Dotchevski wrote:
Really, the reinterpret_cast is portably correct? Pretty much the only thing you can do portably with reinterpret_cast is round-trip cast a pointer type to another pointer type and then cast it back before you use it again.
That's what this code does.
Honestly, I'm probably giving the compiler too much credit, since I assumed that it sees that the object it's taking the address of is a single char, not an array of chars. In reality it's probably not that clever and the warning is plain wrong because in general strict aliasing rules don't apply to char pointers, do they?
I dunno, sorry. -- Dave Abrahams BoostPro Computing http://www.boostpro.com