Ok what about this:
class BasePtr
{
public:
virtual void* obj() = 0;
};
template <class T>
class Ptr :: public BasePtr
{
public:
Ptr() : ptr(0) {};
Ptr(T* a) : ptr(a) {};
virtual T* obj() { return ptr; }
protected:
T* ptr;
};
Use BasePtr in the Base class but pass it the correct template object when Base needs to use it.
template <class a, class b >
class Base
{
public:
Base(){};
void set_ptr( BasePtr* );
};
DDerived dd = DDerived();
Ptr<double,double> p(&dd);
dd.set_ptr( p );
I still do not quite understand your problem but I hope that helps.
David Allan Finch
2009-02-25 13:48:35