diff options
author | Chad Austin <chad@imvu.com> | 2013-04-30 15:01:08 -0700 |
---|---|---|
committer | Chad Austin <chad@imvu.com> | 2013-05-02 18:55:07 -0700 |
commit | 9607e5be25f12ac986436622bdd3b710505a596c (patch) | |
tree | abefc96801dca8f0579b28ea8e46a038a7449245 /tests/embind/embind_test.cpp | |
parent | 54526667562b394f1c3673a48780b18000d798a6 (diff) |
Add isAliasOf for seeing if two embind handles point to the same underlying object.
Conflicts:
tests/embind/embind_test.cpp
Diffstat (limited to 'tests/embind/embind_test.cpp')
-rw-r--r-- | tests/embind/embind_test.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp index 48da45b8..21fbee65 100644 --- a/tests/embind/embind_test.cpp +++ b/tests/embind/embind_test.cpp @@ -2141,3 +2141,18 @@ EMSCRIPTEN_BINDINGS(constants) { StructVector sv(1, 2, 3, 4); constant("VALUE_STRUCT_CONSTANT", sv); } + +class DerivedWithOffset : public DummyDataToTestPointerAdjustment, public Base { +}; + +std::shared_ptr<Base> return_Base_from_DerivedWithOffset(std::shared_ptr<DerivedWithOffset> ptr) { + return ptr; +} + +EMSCRIPTEN_BINDINGS(with_adjustment) { + class_<DerivedWithOffset, base<Base>>("DerivedWithOffset") + .smart_ptr_constructor(&std::make_shared<DerivedWithOffset>) + ; + + function("return_Base_from_DerivedWithOffset", &return_Base_from_DerivedWithOffset); +} |