diff options
author | Chad Austin <caustin@gmail.com> | 2013-03-08 00:17:49 -0800 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-04-12 14:25:29 +0300 |
commit | b2fb12ec07ac4ca271f7138f2bf0fa61f5a701e8 (patch) | |
tree | ce84d6a64ecd79fffc2e6a3341e4f846ad74dc7e | |
parent | b72bbd39389fed75dc6f0ecb594540a209363eff (diff) |
I just learned about the sizeof... operator
-rwxr-xr-x | system/include/emscripten/wire.h | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/system/include/emscripten/wire.h b/system/include/emscripten/wire.h index 07919a5e..3e4a77d9 100755 --- a/system/include/emscripten/wire.h +++ b/system/include/emscripten/wire.h @@ -52,21 +52,6 @@ namespace emscripten { } }; - // count<> - - template<typename... Args> - struct count; - - template<> - struct count<> { - constexpr static unsigned value = 0; - }; - - template<typename T, typename... Args> - struct count<T, Args...> { - constexpr static unsigned value = 1 + count<Args...>::value; - }; - // ExecutePolicies<> template<typename... Policies> @@ -118,15 +103,13 @@ namespace emscripten { struct WithPolicies { template<typename... Args> struct ArgTypeList { - enum { args_count = count<Args...>::value }; - ArgTypeList() { - count = args_count; + count = sizeof...(Args); ArgTypes<0, Args...>::template fill<Policies...>(types); } unsigned count; - TYPEID types[args_count]; + TYPEID types[sizeof...(Args)]; }; }; |