diff options
author | Chad Austin <chad@imvu.com> | 2013-03-07 16:29:10 -0800 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-04-12 14:25:15 +0300 |
commit | e7faeb6d50e26e74d21cc06b7eae8929752f4526 (patch) | |
tree | bea827383dc38cff8fbaaa04c65f159308b612e3 | |
parent | 3ac210596939afee0397fac8d298975d2982bff1 (diff) |
reorder bindingtypes to make it easy to read
-rwxr-xr-x | system/include/emscripten/wire.h | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/system/include/emscripten/wire.h b/system/include/emscripten/wire.h index 5126c4be..07919a5e 100755 --- a/system/include/emscripten/wire.h +++ b/system/include/emscripten/wire.h @@ -231,20 +231,6 @@ namespace emscripten { } }; - template<typename Enum> - struct EnumBindingType { - typedef Enum WireType; - - static WireType toWireType(Enum v) { - return v; - } - static Enum fromWireType(WireType v) { - return v; - } - static void destroy(WireType) { - } - }; - template<typename T> struct GenericBindingType { typedef typename std::remove_reference<T>::type ActualT; @@ -263,6 +249,7 @@ namespace emscripten { } }; + // Is this necessary? template<typename T> struct GenericBindingType<std::unique_ptr<T>> { typedef typename BindingType<T>::WireType WireType; @@ -272,19 +259,18 @@ namespace emscripten { } }; - template<typename T> - struct WireDeleter { - typedef typename BindingType<T>::WireType WireType; - - WireDeleter(WireType wt) - : wt(wt) - {} - - ~WireDeleter() { - BindingType<T>::destroy(wt); + template<typename Enum> + struct EnumBindingType { + typedef Enum WireType; + + static WireType toWireType(Enum v) { + return v; + } + static Enum fromWireType(WireType v) { + return v; + } + static void destroy(WireType) { } - - WireType wt; }; // catch-all generic binding @@ -299,5 +285,20 @@ namespace emscripten { auto toWireType(const T& v) -> typename BindingType<T>::WireType { return BindingType<T>::toWireType(v); } + + template<typename T> + struct WireDeleter { + typedef typename BindingType<T>::WireType WireType; + + WireDeleter(WireType wt) + : wt(wt) + {} + + ~WireDeleter() { + BindingType<T>::destroy(wt); + } + + WireType wt; + }; } } |