From 72c9c492249c309812bf2b49fd3d2b335067f191 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 23 Mar 2017 19:22:42 +0200 Subject: [PATCH] Unroll cx_plus a bit. --- include/boost/mp11/detail/mp_count.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/boost/mp11/detail/mp_count.hpp b/include/boost/mp11/detail/mp_count.hpp index c03128f..12bde18 100644 --- a/include/boost/mp11/detail/mp_count.hpp +++ b/include/boost/mp11/detail/mp_count.hpp @@ -36,6 +36,12 @@ template constexpr std::size_t cx_plus(T1 t1, T... t) return t1 + cx_plus(t...); } +template +constexpr std::size_t cx_plus(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T... t) +{ + return t1 + t2 + t3 + t4 + t5 + t6 + t7 + t8 + t9 + t10 + cx_plus(t...); +} + template class L, class... T, class V> struct mp_count_impl, V> { using type = mp_size_t::value...)>;