I wrote this template class for pointers usage
(I need smart pointers, but I can't use boost or C++11):

```
template<class T>
class TreePointer{
public:
    TreePointer(){
        isRefOnly=false;  
        data=NULL;
    };
    TreePointer(T* data){
        this->data=data;
        this->isRefOnly=false;   
    }
    TreePointer(const TreePointer& anotherPtr){
        this->data=anotherPtr.data;
        this->isRefOnly=true;
    }
    virtual ~TreePointer(){
        if (!isRefOnly){                        
            delete data;
        }        
    }    
    T* operator->() const{
        return data;
    }
    void operator=(const TreePointer &anotherPtr){ 
        this->data=anotherPtr.data;
        this->isRefOnly=true;
    }        
private:
    T* data;
    bool isRefOnly;
};

```

And I have big class with many methods, like this:

```
class WrittenBigClassWithManyMethods{
public:
    WrittenBigClassWithManyMethods(int v){
        this->v=v;
    }    
    int sum(WrittenBigClassWithManyMethods* a){
        return v+a->v;
    }
    int v;
};

```

This usage of my smart pointers work perfectly:

```
TreePointer<WrittenBigClassWithManyMethods> tp(new WrittenBigClassWithManyMethods(5));
WrittenBigClassWithManyMethods* simpleClass=new WrittenBigClassWithManyMethods(5);
cout << tp->sum(simpleClass);

```

But it usage isn't work:

```
TreePointer<WrittenBigClassWithManyMethods> tp2(new WrittenBigClassWithManyMethods(5));
cout << tp->sum(tp2);

```

How i can change my template for pointers to make invoking methrod **sum** of class **WrittenBigClassWithManyMethods** with parameter of type **TreePointer**, without any changes for class **WrittenBigClassWithManyMethods** and its any usages? If this is not possible, how I minimize the changes for class **WrittenBigClassWithManyMethods** and its usage?