mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 14:16:09 -06:00
34 lines
716 B
C++
34 lines
716 B
C++
#include <Core/Core.h>
|
|
|
|
#define Union NewUnion
|
|
|
|
template <class T>
|
|
int StaticTypeNo() {
|
|
static int typeno = -1;
|
|
if(typeno < 0)
|
|
typeno = RegisterTypeNo(typeid(T).name());
|
|
return typeno;
|
|
}
|
|
|
|
CONSOLE_APP_MAIN
|
|
{
|
|
Union test;
|
|
test.Create<String>();
|
|
test.Get<String>() = "ahoj";
|
|
test.Is<String>();
|
|
__BREAK__;
|
|
test.Is<String>();
|
|
__BREAK__;
|
|
DUMP(test.Is<String>());
|
|
DUMP(test.Is<int>());
|
|
DUMP(test.Get<String>());
|
|
DUMP((String)test);
|
|
DUMP(StaticTypeNo<int>());
|
|
DUMP(StaticTypeNo<Value>());
|
|
DUMP(StaticTypeNo<Stream>());
|
|
DUMP(StaticTypeNo<FileIn>());
|
|
DUMP(StaticTypeNo<int>());
|
|
DUMP(StaticTypeNo<Value>());
|
|
DUMP(StaticTypeNo<Stream>());
|
|
DUMP(StaticTypeNo<FileIn>());
|
|
}
|