aboutsummaryrefslogtreecommitdiff
path: root/tests/embind
diff options
context:
space:
mode:
authorAndy Friesen <andy@imvu.com>2013-12-04 12:43:42 -0800
committerBruce Mitchener <bruce.mitchener@gmail.com>2014-02-04 16:18:42 +0700
commit4fa2f8933821050fd10fd973f2f619422a807c94 (patch)
treef336089ae8829ede94e540eef2c5715e44cb5990 /tests/embind
parent34798ee526774bf5040bf5153575e867c82a72e5 (diff)
Add operator_new to smart_ptr_trait.
Diffstat (limited to 'tests/embind')
-rw-r--r--tests/embind/embind_test.cpp5
1 files changed, 5 insertions, 0 deletions
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<HeldBySmartPtr> takesHeldBySmartPtrSharedPtr(std::shared_ptr<Hel
namespace emscripten {
template<typename T>
struct smart_ptr_trait<CustomSmartPtr<T>> {
+ typedef CustomSmartPtr<T> 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<T>(ptr);
}
+
+ static pointer_type* operator_new() {
+ return new pointer_type();
+ }
};
}