SharedLib: Use std::is_function instead of IsFunc
This commit is contained in:
parent
7a0612b0ba
commit
041d5b3974
@ -4,6 +4,7 @@
|
||||
#include <utility>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <uv.h>
|
||||
#include "loop.hpp"
|
||||
|
||||
@ -11,16 +12,6 @@
|
||||
namespace uvw {
|
||||
|
||||
|
||||
namespace details {
|
||||
|
||||
|
||||
template<typename T> struct IsFunc: std::false_type { };
|
||||
template<typename R, typename... A> struct IsFunc<R(A...)>: std::true_type { };
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief The SharedLib class.
|
||||
*
|
||||
@ -73,7 +64,7 @@ public:
|
||||
*/
|
||||
template<typename F>
|
||||
F * sym(std::string name) {
|
||||
static_assert(details::IsFunc<F>::value, "!");
|
||||
static_assert(std::is_function<F>::value, "!");
|
||||
F *func;
|
||||
auto err = uv_dlsym(&lib, name.data(), reinterpret_cast<void**>(&func));
|
||||
if(err) { func = nullptr; }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user