#ifndef SHARED_PTR_H #define SHARED_PTR_H /* TODO includes */ #undef SOLVED_1 //#define SOLVED_1 namespace Ti { /* TODO helpers */ template class shared_ptr { private: /* TODO data */ public: shared_ptr(); T* get() const; shared_ptr (const shared_ptr& other); template shared_ptr (const shared_ptr& other); template explicit shared_ptr (O* p); shared_ptr& operator = (const shared_ptr& other); template shared_ptr& operator = (const shared_ptr& other); ~shared_ptr (); T& operator * () const; T* operator -> () const; void swap (shared_ptr& other); inline void reset(); private: template friend shared_ptr make_shared (Args...); template friend bool operator == (const shared_ptr& a, const shared_ptr& b); template friend bool operator == (const shared_ptr& a, const U2* b); template friend bool operator == (const U1* a, const shared_ptr& b); template friend bool operator != (const shared_ptr& a, const U2* b); template friend bool operator != (const U1* a, const shared_ptr& b); template friend bool operator != (const shared_ptr& a, const shared_ptr& b); template friend shared_ptr shared_dynamic_cast (const shared_ptr& from); }; template shared_ptr make_shared (/* TODO */); template shared_ptr shared_dynamic_cast (const shared_ptr& from); } // end namespace ti namespace std { using namespace Ti; template inline void swap (shared_ptr& t1, shared_ptr& t2); /* TODO */ } #endif /* vim: set et sw=2 ts=2: */