#ifndef PTR_H #define PTR_H class Pekad; class Ptr{ public: Ptr(Pekad * pek = 0); Ptr(const Ptr& other); ~Ptr(); Ptr& operator=(const Ptr& other); Pekad& operator*() const; Pekad* operator->() const; bool operator==(const Ptr& other) const; bool operator!=(const Ptr& other) const; private: Pekad * pointer; int * count; }; class Pekad{ public: static Ptr create(); getName(); private: string namn; }; inline Pekad& Ptr::operator*() const{ return *pointer; } inline Pekad* Ptr::operator->() const{ return pointer; } inline bool Ptr::operator==(const Ptr& other) const{ return pointer == other.pointer; } inline bool Ptr::operator!=(const Ptr& other) const{ return pointer != other.pointer; } #endif