From 92fa032ff4ed8c9168f395409be84416c4e0c34b Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sat, 4 Aug 2018 11:00:17 -0400 Subject: [PATCH] fix arity accumulation --- sol/types.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sol/types.hpp b/sol/types.hpp index 8357fa55..90efe329 100644 --- a/sol/types.hpp +++ b/sol/types.hpp @@ -1046,6 +1046,12 @@ namespace sol { template class V, typename T, typename... Args> struct accumulate : accumulate::value, V, Args...> {}; + + template class V, typename List> + struct accumulate_list; + + template class V, typename... Args> + struct accumulate_list> : accumulate {}; } // namespace detail template @@ -1152,9 +1158,9 @@ namespace sol { public: typedef std::integral_constant::value != 0> runtime_variadics_t; static const std::size_t true_arity = base_t::arity; - static const std::size_t arity = base_t::arity - meta::count_for::value; + static const std::size_t arity = detail::accumulate_list::value - meta::count_for::value; static const std::size_t true_free_arity = base_t::free_arity; - static const std::size_t free_arity = base_t::free_arity - meta::count_for::value; + static const std::size_t free_arity = detail::accumulate_list::value - meta::count_for::value; }; template