ptr()   {     if(reference != nullptr)     {       reference->count--;       if(reference->count == 0)       {         if(reference->ptr != nullptr)         {           delete reference->ptr;           reference->ptr = nullptr;         }         delete reference;         reference = nullptr;       }     }   }   T &operator*()   {     return *(reference->ptr);   }   const T &operator*() const   {     return *(reference->ptr);   }   T *operator->()   {     return reference->ptr;   }   const T *operator->() const   {     return reference->ptr;   }    //private: // (to uncomment)   