aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-03-14 01:03:39 -0700
committerJukka Jylänki <jujjyl@gmail.com>2013-04-12 14:25:55 +0300
commitfb92020f00a7ae5b43927927b1ec571afc161bf1 (patch)
treec98263cc086a28dcc388a7804af2c3213e5ccd7a
parentddb31f11310847b50e4e27f0d64390b55809eecd (diff)
Add a static assertion that a classes's smart_ptr is compatible
-rwxr-xr-xsystem/include/emscripten/bind.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h
index f06ca69c..10d0d926 100755
--- a/system/include/emscripten/bind.h
+++ b/system/include/emscripten/bind.h
@@ -722,11 +722,10 @@ namespace emscripten {
class_& smart_ptr() {
using namespace internal;
- // TODO: assert that PointeeType is identical to ClassType
-
typedef smart_ptr_trait<PointerType> PointerTrait;
typedef typename PointerTrait::element_type PointeeType;
+ static_assert(std::is_same<ClassType, typename std::remove_cv<PointeeType>::type>::value, "smart pointer must point to this class");
_embind_register_smart_ptr(
TypeID<PointerType>::get(),