John Love-Jensen wrote:
The fast code works, but not with gcc-4.0, -O3 and strict aliasing. Since there is a fast way to do it, and it works, it is a pity that it can not be easily used. Especially since it is such an easy problem; to create an ordering functor for a 32-bit type consisting of 2 16-bit types.Well, I suppose it is a tradeoff between correct code that works-but-is-slow and incorrect code that is fast-and-doesn't-work.