aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/include/emscripten/bind.h10
-rw-r--r--tests/embind/embind_test.cpp4
2 files changed, 4 insertions, 10 deletions
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h
index 1c7daeba..0de16043 100644
--- a/system/include/emscripten/bind.h
+++ b/system/include/emscripten/bind.h
@@ -890,7 +890,7 @@ namespace emscripten {
}
template<typename PointerType>
- const class_& smart_ptr(const char* name = typeid(PointerType).name()) const {
+ const class_& smart_ptr(const char* name) const {
using namespace internal;
typedef smart_ptr_trait<PointerType> PointerTrait;
@@ -933,12 +933,6 @@ namespace emscripten {
}
template<typename SmartPtr, typename... Args, typename... Policies>
- const class_& smart_ptr_constructor(SmartPtr (*factory)(Args...), Policies&&... policies) const {
- // TODO: once everyone has manually specified a name, remove this
- return smart_ptr_constructor(typeid(SmartPtr).name(), factory, std::forward<Policies>(policies)...);
- }
-
- template<typename SmartPtr, typename... Args, typename... Policies>
const class_& smart_ptr_constructor(const char* smartPtrName, SmartPtr (*factory)(Args...), Policies...) const {
using namespace internal;
@@ -955,7 +949,7 @@ namespace emscripten {
}
template<typename WrapperType, typename PointerType = WrapperType*>
- const class_& allow_subclass(const char* wrapperClassName = typeid(WrapperType).name()) const {
+ const class_& allow_subclass(const char* wrapperClassName) const {
using namespace internal;
auto cls = class_<WrapperType, base<ClassType>>(wrapperClassName)
diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp
index 48529b9e..1b835751 100644
--- a/tests/embind/embind_test.cpp
+++ b/tests/embind/embind_test.cpp
@@ -1826,7 +1826,7 @@ EMSCRIPTEN_BINDINGS(tests) {
auto HeldBySmartPtr_class = class_<HeldBySmartPtr>("HeldBySmartPtr");
HeldBySmartPtr_class
.smart_ptr<CustomSmartPtr<HeldBySmartPtr>>("CustomSmartPtr<HeldBySmartPtr>")
- .smart_ptr_constructor(&std::make_shared<HeldBySmartPtr, int, std::string>)
+ .smart_ptr_constructor("shared_ptr<HeldbySmartPtr>", &std::make_shared<HeldBySmartPtr, int, std::string>)
.class_function("newCustomPtr", HeldBySmartPtr::newCustomPtr)
.function("returnThis", &takesHeldBySmartPtrSharedPtr)
.property("i", &HeldBySmartPtr::i)
@@ -2249,7 +2249,7 @@ std::shared_ptr<Base> return_Base_from_DerivedWithOffset(std::shared_ptr<Derived
EMSCRIPTEN_BINDINGS(with_adjustment) {
class_<DerivedWithOffset, base<Base>>("DerivedWithOffset")
- .smart_ptr_constructor(&std::make_shared<DerivedWithOffset>)
+ .smart_ptr_constructor("shared_ptr<DerivedWithOffset>", &std::make_shared<DerivedWithOffset>)
;
function("return_Base_from_DerivedWithOffset", &return_Base_from_DerivedWithOffset);