On Thursday, 5 March 2015 at 20:32:20 UTC, anonymous wrote:
That's not really simpler, though.

Maybe, but I think the union is a bit nicer because then the compiler is responsible for more of the details. For example, it should work with class objects without the complication of dealing with the fact that they are already pointers under the hood.

Either way works though and should compile to the same instructions, just if I was doing it as a generic library, I think I'd use the union method.

Reply via email to