Hi everybody:
I have implemented a Ptr<Ttemplate class that I want to use in my
framework.
Let's say I have:
template <class T>
class Ptr<T>;
class A;
class B : public A;
class C
{
public:
...
int GetValue(Ptr<Aval);
};
I want to instance my objects using my smart pointer:
Ptr<Bb(new B());
If I would use a standard pointer, the calling to int GetValue(A* val);
would be:
c->GetValue(b); //valid using standard pointers
but it does not compile using my notation because there is no match
between
Ptr<Aand Ptr<B>.
How can I implement my smart pointer to be able to call
c->GetValue(b);
using my smart pointers?
Regards,
Ernesto