P
pauldepstein
Here is the problem piece of my code:
Please note that SafePointerToCats is a safe pointer (boost library)
to the Cats class, DerivedFromCats is a class that is derived from
Cats and SafePointerToDerivedFromCats is a safe pointer to
DerivedFromCats.
PointerToSomeClass is a safe pointer to SomeClass
class SomeClass
{
private: SafePointerToCats CatPointer;
public: SomeClass() {}
void setCatPointer (SafePointerToCats cat){CatPointer =
cat;}
};
//Then in some other file..
void DerivedFromCats::SomeFunction( someparameter& something,
anotherparameter& anotherthing)
{
PointerToSomeClass PointersAreCool ( new SomeClass());
PointersAreCool -> setCatPointer (this);
}
My hope was that this code would result in in CatPointer pointing at
the derived class. Instead it gave a compile error.
What is wrong here?
Thanks for your help,
Paul Epstein
Please note that SafePointerToCats is a safe pointer (boost library)
to the Cats class, DerivedFromCats is a class that is derived from
Cats and SafePointerToDerivedFromCats is a safe pointer to
DerivedFromCats.
PointerToSomeClass is a safe pointer to SomeClass
class SomeClass
{
private: SafePointerToCats CatPointer;
public: SomeClass() {}
void setCatPointer (SafePointerToCats cat){CatPointer =
cat;}
};
//Then in some other file..
void DerivedFromCats::SomeFunction( someparameter& something,
anotherparameter& anotherthing)
{
PointerToSomeClass PointersAreCool ( new SomeClass());
PointersAreCool -> setCatPointer (this);
}
My hope was that this code would result in in CatPointer pointing at
the derived class. Instead it gave a compile error.
What is wrong here?
Thanks for your help,
Paul Epstein