|
From: Petr T. <pto...@ss...> - 2001-11-27 19:41:24
|
Tak tady tohle mi nefunguje. Uz me to nejak zase nefunguje ani to =
prirazeni, safra, mozna tam mam jen nejakou stupidni chybu...
Petr
#define __DEBUG__ 1
#include "reference.h"
using namespace Massiv;
using namespace Massiv::Core;
class TestClass : public SharedObject
{
};
class TestClassSon : public TestClass
{
};
int main()
{
Reference<TestClass> tc1;
Reference<TestClassSon> tc2;
tc2 =3D new TestClassSon;
// error C2679: binary '=3D' : no operator defined which takes a =
right-hand=20
// operand of type 'class Massiv::Core::Reference<class TestClassSon>'=20
// (or there is no acceptable conversion).
tc1 =3D tc2;
// warning C4541: 'dynamic_cast' used on polymorphic type=20
// 'class Massiv::Core::SharedObject' with /GR-;=20
// unpredictable behavior may result
// while compiling class-template member function=20
// '__thiscall Massiv::Core::reference_cast<class TestClass>
// ::Massiv::Core::reference_cast<class TestClass>
// (class Massiv::Core::SharedObject *)'
tc1 =3D reference_cast<TestClass>( new TestClassSon );
return 0;
}
|