#pragma once #include namespace MiniEngine { class ResourceHandler { public: using RawDeleter = std::function; template ResourceHandler(T* ResourcePtr,RawDeleter RawDelFunc) : _ptr(ResourcePtr), _delfunc(RawDelFunc) {} ~ResourceHandler() { _delfunc(_ptr); } template T* get() const { return (T*)(_ptr); } template const T* cget() const { return (const T*)(_ptr); } private: void* _ptr; RawDeleter _delfunc; }; }/// End of namespace MiniEngine