FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.robertl / eb112.C
blobc0231b7095564d8f1f68c358dfad5a1f84ac4c60
1 // Build don't link: 
2 template <class STRUCT, class MEMBER> inline STRUCT *
3 setback(MEMBER *bp, MEMBER STRUCT::*offset)
5         // The implementation of this function may be platform dependend
6         if(!bp) return 0; // NULL pointers remain NULL
7         union { int i; MEMBER STRUCT::*of; } u; // Switch types. Casting won't work.
8         u.of = offset;
9         return (STRUCT *) ((int) bp - u.i);