//------------------------------------------------------------------- // Pointer_1.h (non-checking implementation) //------------------------------------------------------------------- #ifndef POINTER_1_H #define POINTER_1_H #define New(p) p.Allocate () #define Delete(p) p.Deallocate () template class Pointer { public: Pointer () { } Pointer (void* a) { rep = reinterpret_cast (a); } Pointer& operator= (const void* a) { rep = reinterpret_cast (a); return *this; } bool operator== (const Pointer& a) { return rep == a.rep; } bool operator== (const void* a) { return rep == reinterpret_cast (a); } bool operator!= (const Pointer& a) { return rep != a.rep; } bool operator!= (const void* a) { return rep != reinterpret_cast (a); } void Allocate () { rep = new T; } void Deallocate () { delete rep; } T* operator-> () { return rep; } T& operator* () { return *rep; } private: T* rep; }; void Report_Storage_Allocation () {} #endif // POINTER_1_H