diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/include/emscripten/bind.h | 4 | ||||
-rw-r--r-- | system/include/emscripten/wire.h | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h index 7bc28ff6..67e7c6a3 100644 --- a/system/include/emscripten/bind.h +++ b/system/include/emscripten/bind.h @@ -422,8 +422,8 @@ namespace emscripten { namespace internal { template<typename ClassType, typename... Args> - ClassType* operator_new(Args... args) { - return new ClassType(args...); + ClassType* operator_new(Args&&... args) { + return new ClassType(std::forward<Args>(args)...); } template<typename WrapperType, typename ClassType, typename... Args> diff --git a/system/include/emscripten/wire.h b/system/include/emscripten/wire.h index c20e2f55..1a9432d6 100644 --- a/system/include/emscripten/wire.h +++ b/system/include/emscripten/wire.h @@ -293,7 +293,6 @@ namespace emscripten { } }; - // Is this necessary? template<typename T> struct GenericBindingType<std::unique_ptr<T>> { typedef typename BindingType<T>::WireType WireType; @@ -301,6 +300,10 @@ namespace emscripten { static WireType toWireType(std::unique_ptr<T> p) { return BindingType<T>::toWireType(*p); } + + static std::unique_ptr<T> fromWireType(WireType wt) { + return std::unique_ptr<T>(new T(std::move(BindingType<T>::fromWireType(wt)))); + } }; template<typename Enum> |