Re: [Algorithms] How to get 3dvector largest coordinate index?
Brought to you by:
vexxed72
From: <chr...@pl...> - 2009-03-05 03:05:35
|
Jeff Russell wrote: > if cast-through-union violates the standard, then why are unions in > the language? isn't storing bytes and interpreting them as different > types what unions are for? No, that's not what unions are for. Unions are there to allow you to store different type data in the same memory location at DIFFERENT (nonoverlapping) TIMES. Standard-violating aliasing is when you have different type data in the same memory location at the SAME TIME. The standard disallows same-time different-type aliasing, because disallowing it allows for a lot of optimization opportunities. This is a GOOD THING -- except programmers need to learn to write standard-conforming code (which is also a GOOD THING). Christer Ericson, Director of Tools and Technology Sony Computer Entertainment, Santa Monica |