ultimatepp/uppdev/PtrPte/PtrPte.cpp
cxl 4a1c627474 Adding uppdev....
git-svn-id: svn://ultimatepp.org/upp/trunk@328 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2008-08-15 08:36:24 +00:00

45 lines
608 B
C++

#include <Core/Core.h>
struct Foo : Pte<Foo> {
virtual void Test() { LOG("BASE!"); }
int bar;
};
struct Derived : Date, Foo {
virtual void Test() { LOG("DERIVED!"); }
int bar2;
};
CONSOLE_APP_MAIN
{
Ptr<Derived> pd;
{
Derived d;
pd = &d;
Callback x = callback(&d, &Foo::Test);
x();
DUMP((void *)&d);
DUMP((void *)~pd);
DUMP(pd);
}
DUMP(pd);
Uuid uuid;
Ptr<Foo> x;
{
Foo a;
DUMP((void *)&a);
DUMP(x);
x = &a;
DUMP(x);
uuid = x.GetUuid();
DUMP(x);
DUMP(a.GetUuid());
}
DUMP(x);
Foo a;
a.SetUuid(uuid);
DUMP(x);
}