mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 06:05:58 -06:00
25 lines
400 B
C++
25 lines
400 B
C++
#include <Core/Core.h>
|
|
|
|
using namespace Upp;
|
|
|
|
struct Base { int x; virtual ~Base() {} };
|
|
struct Derived : Base { int y; };
|
|
|
|
CONSOLE_APP_MAIN
|
|
{
|
|
One<int> x;
|
|
x.Create();
|
|
|
|
One<Base> o;
|
|
|
|
ASSERT(!o.Is<Base>());
|
|
ASSERT(!o.Is<Derived>());
|
|
|
|
o.Create();
|
|
ASSERT(o.Is<Base>());
|
|
ASSERT(!o.Is<Derived>());
|
|
|
|
o.Create<Derived>();
|
|
ASSERT(o.Is<Base>());
|
|
ASSERT(o.Is<Derived>());
|
|
}
|