From 4fa2f8933821050fd10fd973f2f619422a807c94 Mon Sep 17 00:00:00 2001 From: Andy Friesen Date: Wed, 4 Dec 2013 12:43:42 -0800 Subject: Add operator_new to smart_ptr_trait. --- tests/embind/embind_test.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/embind') diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp index 1d871924..401b2734 100644 --- a/tests/embind/embind_test.cpp +++ b/tests/embind/embind_test.cpp @@ -1283,6 +1283,7 @@ std::shared_ptr takesHeldBySmartPtrSharedPtr(std::shared_ptr struct smart_ptr_trait> { + typedef CustomSmartPtr pointer_type; typedef T element_type; static sharing_policy get_sharing_policy() { @@ -1297,6 +1298,10 @@ namespace emscripten { ++ptr->refcount; // implement an adopt API? return CustomSmartPtr(ptr); } + + static pointer_type* operator_new() { + return new pointer_type(); + } }; } -- cgit v1.2.3-18-g5258