#ifndef IRROBJ_H #define IRROBJ_H #include //template const char* typeof(T&) { return "unknown"; } // default //template<> const char* typeof(Irr3DLibObj&) { return "Irr3DLibObj"; } //template<> const char* typeof(float&) { return "float"; } template class IrrObj { T* ptr; public: explicit IrrObj(T* p = 0) : ptr(p) {std::cout << "Constructing an IrrObj" << std::endl; if (p == NULL) ptr = new T;} ~IrrObj() {std::cout << "Destructing an IrrObj" << std::endl; delete ptr;} T& operator*() {return *ptr;} T* operator->() {return ptr;} void remove() {delete ptr;} }; #endif