
10 Sep
2011
10 Sep
'11
1:55 a.m.
On 09/09/2011 04:13 PM, Beman Dawes wrote:
I'm not sure I do either. I'd be curious to see a reference to the wording in the standard that Mathias thinks comes into play.
I'm also curious what you didn't just write:
return reinterpret_cast<ubig32_t>(src);
gcc gives me: invalid cast from type ‘uint32_t’ to type ‘boost::endian::ubig32_t I've only ever used reinterpret_cast on pointers, so doing the above didn't even occur to me. I had to try it to see whether or not it would work. Using static_cast doesn't work because it does the byteswap operation twice, making the function a no-op.