aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-02-28 13:45:46 -0800
committerJukka Jylänki <jujjyl@gmail.com>2013-04-12 14:24:36 +0300
commitf23cc669e328eec1c088b2a39637ccef7dfb5e84 (patch)
treedebf2e84d5dbad448fa77bf76ded0436cb3086e2
parentf22f5867872ffc07ba3e3a75472009d4fe4e0b42 (diff)
Add support for rvalue reference parameters on factories. I don't really understand this code.
-rwxr-xr-xsrc/embind/embind.js4
-rwxr-xr-xsystem/include/emscripten/wire.h11
2 files changed, 13 insertions, 2 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js
index 589f7ba9..b5be4602 100755
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -840,7 +840,7 @@ function __embind_register_class_constructor(
var argTypes = requireArgumentTypes(rawArgTypes, humanName);
classType.constructor.body = function() {
if (arguments.length !== argCount - 1) {
- throwBindingError('emscripten binding ' + humanName + ' called with ' + arguments.length + ' arguments, expected ' + (argCount-1));
+ throwBindingError(humanName + ' called with ' + arguments.length + ' arguments, expected ' + (argCount-1));
}
var destructors = [];
var args = new Array(argCount);
@@ -873,7 +873,7 @@ function __embind_register_class_smart_ptr_constructor(
var argTypes = requireArgumentTypes(rawArgTypes, humanName);
classType.constructor.body = function() {
if (arguments.length !== argCount - 1) {
- throwBindingError(humanName + ' + called with ' + arguments.length + ' arguments, expected ' + (argCount-1));
+ throwBindingError(humanName + ' called with ' + arguments.length + ' arguments, expected ' + (argCount-1));
}
var destructors = [];
var args = new Array(argCount);
diff --git a/system/include/emscripten/wire.h b/system/include/emscripten/wire.h
index 1be23e78..d4efc3ac 100755
--- a/system/include/emscripten/wire.h
+++ b/system/include/emscripten/wire.h
@@ -210,6 +210,17 @@ namespace emscripten {
};
template<typename T>
+ struct BindingType<T&&> {
+ typedef typename BindingType<T>::WireType WireType;
+ static WireType toWireType(const T& v) {
+ return BindingType<T>::toWireType(v);
+ }
+ static T fromWireType(WireType wt) {
+ return BindingType<T>::fromWireType(wt);
+ }
+ };
+
+ template<typename T>
struct BindingType<T*> {
typedef T* WireType;
static WireType toWireType(T* p) {