diff options
author | Chad Austin <chad@imvu.com> | 2014-06-24 11:49:27 -0700 |
---|---|---|
committer | Chad Austin <chad@chadaustin.me> | 2014-06-26 23:12:50 -0700 |
commit | a68e862aa31b25c9fbb8e44cda3cdf3af5d6156e (patch) | |
tree | c3c60ed38e00064ae23062850a82df2d572948a5 | |
parent | 61eac11880494d0d99aa104a0aee97a1c8071d44 (diff) |
Remove a bunch of cleverness. Turns out you can generate constexpr arrays. :P
-rw-r--r-- | system/include/emscripten/wire.h | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/system/include/emscripten/wire.h b/system/include/emscripten/wire.h index 43f3ccf1..d61b0bc7 100644 --- a/system/include/emscripten/wire.h +++ b/system/include/emscripten/wire.h @@ -172,40 +172,15 @@ namespace emscripten { >::type type; }; - // ArgArray - - template<typename... Args> - struct ArgArray; - - template<typename First, typename... Rest> - struct ArgArray<First, Rest...> { - constexpr ArgArray() - : element(TypeID<First>::get()) - {} - - const TYPEID element; - ArgArray<Rest...> rest; - }; - - template<> - struct ArgArray<> { - }; template<typename ArgList> struct ArgArrayGetter; - template<> - struct ArgArrayGetter<TypeList<>> { - static const TYPEID* get() { - return nullptr; - } - }; - template<typename... Args> struct ArgArrayGetter<TypeList<Args...>> { static const TYPEID* get() { - static constexpr ArgArray<Args...> aa; - return &aa.element; + static constexpr TYPEID types[] = { TypeID<Args>::get()... }; + return types; } }; |