
12 Oct
2007
12 Oct
'07
8:47 a.m.
Sebastian Redl wrote:
The answer is still no. The standard says (9.2/16):
Ok, I think I got the point. I think the situation is even worse than I initially was thinking of: 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? Roland aka speedsnail