#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) {if (p == NULL) ptr = new T;} ~IrrObj() {if (ptr!=0) delete ptr;} T& operator*() {return *ptr;} T* operator->() {return ptr;} void remove() {delete ptr;} }; #endif