diff options
author | Chad Austin <chad@imvu.com> | 2013-04-15 22:26:21 -0700 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-04-18 20:08:15 +0300 |
commit | 426cbf616c7a4465e707d6f5cd0d11ab9ce27905 (patch) | |
tree | 60bf78741f58c566a8cd0076438f05134ce780a9 /tests/embind/embind_test.cpp | |
parent | d2e6efdf4821ff1e9f16fc4884d398619c0d7a06 (diff) |
Support returning movable types
Diffstat (limited to 'tests/embind/embind_test.cpp')
-rw-r--r-- | tests/embind/embind_test.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp index 86d850e0..ce133112 100644 --- a/tests/embind/embind_test.cpp +++ b/tests/embind/embind_test.cpp @@ -2088,15 +2088,26 @@ class Noncopyable { public:
Noncopyable() {}
+ Noncopyable(Noncopyable&& other) {
+ other.valid = false;
+ }
std::string method() const {
return "foo";
}
+
+ bool valid = true;
};
+Noncopyable getNoncopyable() {
+ return Noncopyable();
+}
+
EMSCRIPTEN_BINDINGS(noncopyable) {
class_<Noncopyable>("Noncopyable")
.constructor<>()
.function("method", &Noncopyable::method)
;
+
+ function("getNoncopyable", &getNoncopyable);
}
|