On Thu, 26 Nov 2015 07:43:24 +0530, Agustín K-ballo Bergé
As for the original topic, I am certain that having the proposed macro would be a mistake. Don't try to fool a language/compiler smarter than you, or you will end up getting what you asked for (UB) sooner or later. If you have types whose values are comprised by just a set of bits, and you'd wish to operate on said value representation, then do so by using the tools for operating on the value representation of such trivial types. Type punning via unions is not that tool.
IMNHO that's just generic paranoia and refusing to even look outside the box...we'd still be using C++98 with this kind of thinking (e.g. Boost.Move is 'fooling' the pre-C++11 compiler just like templates weren't originally designed as a tool for TMP or CRTP)... Not to mention that various compilers explicitly prescribe ways to be 'fooled' (union type punning for GCC&compatibles, MSVC does not use the aliasing rules at all - Windows wouldn't boot if it did, etc...) -- "What Huxley teaches is that in the age of advanced technology, spiritual devastation is more likely to come from an enemy with a smiling face than from one whose countenance exudes suspicion and hate." Neil Postman --- Ova e-pošta je provjerena na viruse Avast protuvirusnim programom. https://www.avast.com/antivirus