diff options
author | Chad Austin <chad@imvu.com> | 2013-03-11 13:12:42 -0700 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-04-12 14:25:44 +0300 |
commit | 495c40ce186d5b852f3bc3430058a24a94c72dba (patch) | |
tree | 3d53f6b222a8480d89375adadeb080dddf7246a3 | |
parent | 808e914ce1a0a0388d0bb6f6c4dadf935ad35f4e (diff) |
enable_if is scary and cool
-rwxr-xr-x | system/include/emscripten/bind.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h index fd2e928a..4b9968dc 100755 --- a/system/include/emscripten/bind.h +++ b/system/include/emscripten/bind.h @@ -682,24 +682,22 @@ namespace emscripten { public: class_() = delete; + template<typename = typename std::enable_if<!internal::is_ptr<ClassType>::value>::type> explicit class_(const char* name) { using namespace internal; BaseSpecifier::template verify<ClassType>(); - if (is_ptr<ClassType>::value) { - } else { - _embind_register_class( - TypeID<ClassType>::get(), - TypeID<AllowedRawPointer<ClassType>>::get(), - TypeID<AllowedRawPointer<const ClassType>>::get(), - BaseSpecifier::get(), - BaseSpecifier::template getUpcaster<ClassType>(), - BaseSpecifier::template getDowncaster<ClassType>(), - std::is_polymorphic<ClassType>::value, - name, - reinterpret_cast<GenericFunction>(&raw_destructor<ClassType>)); - } + _embind_register_class( + TypeID<ClassType>::get(), + TypeID<AllowedRawPointer<ClassType>>::get(), + TypeID<AllowedRawPointer<const ClassType>>::get(), + BaseSpecifier::get(), + BaseSpecifier::template getUpcaster<ClassType>(), + BaseSpecifier::template getDowncaster<ClassType>(), + std::is_polymorphic<ClassType>::value, + name, + reinterpret_cast<GenericFunction>(&raw_destructor<ClassType>)); } template<typename... ConstructorArgs, typename... Policies> |