#include #define Union NewUnion template int StaticTypeNo() { static int typeno = -1; if(typeno < 0) typeno = RegisterTypeNo(typeid(T).name()); return typeno; } CONSOLE_APP_MAIN { Union test; test.Create(); test.Get() = "ahoj"; test.Is(); __BREAK__; test.Is(); __BREAK__; DUMP(test.Is()); DUMP(test.Is()); DUMP(test.Get()); DUMP((String)test); DUMP(StaticTypeNo()); DUMP(StaticTypeNo()); DUMP(StaticTypeNo()); DUMP(StaticTypeNo()); DUMP(StaticTypeNo()); DUMP(StaticTypeNo()); DUMP(StaticTypeNo()); DUMP(StaticTypeNo()); }