From d8e8deb03121f132596a4fb48d05f8955e9dc83b Mon Sep 17 00:00:00 2001 From: kiritow <1362050620@qq.com> Date: Wed, 31 May 2017 22:30:10 +0800 Subject: [PATCH] Add template-like get method in class SharedLibrary --- MiniEngine.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MiniEngine.h b/MiniEngine.h index 24caaf3..3379096 100644 --- a/MiniEngine.h +++ b/MiniEngine.h @@ -478,6 +478,13 @@ namespace MiniEngine ~SharedLibrary(); int load(const std::string& Filename); int unload(); + + template + std::function get(const std::string& FunctionName) + { + return std::function(reinterpret_cast(get(FunctionName))); + } + void* get(const std::string& FunctionName); void release(); private: