Why does it invoke undefined behaviour? Could you refer me to a
relevant section in the standard that states the reason? And where in
the standard does it state that & -> cancel each other out?
It invokes undefined behaviour *precisely* because the standard does
*not* say that & and -> cancel each other out.
This is irrelevant. As long as the standard doesn't require it, an
implementation where this sort of macro would not work is fully legal.
The compiler writer knows what works on his/her compiler and what does
not - therefore he/she can write macros like these like no one's
business, as long as they don't directly contradict the standard. You,
on the other hand (meaning Mantorok, Dan Pop, myself, and pretty much
everyone else), can not.
--
/-- Joona Palaste (
[email protected]) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
|
http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"This isn't right. This isn't even wrong."
- Wolfgang Pauli