
12 Oct
2007
12 Oct
'07
8:58 a.m.
Roland Schwarz wrote:
So even in the following case where T is an POD-object type:
struct U { T t; };
and when sizeof(T) == sizeof(U)
I am allowed to:
T t; U u1; U u2;
memcpy(&t,&u1,sizeof(T); memcpy(&u2,&t,sizeof(T);
and rely on u1 == u2, but may not rely on: t == u1 or t == u2, because there are no guarantees about value representation guarantees between U and T.
Correct?
Yes, I think this is correct. Sebastian Redl