From bba027610f43e3cbe7e377afa71e84508c36a838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Wed, 22 May 2019 11:03:50 +0200 Subject: [PATCH] Fix GCC sign conversion warning The conversion bool -> int -> std::size_t triggers GCC sign conversion warning. --- include/boost/mp11/detail/mp_count.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/mp11/detail/mp_count.hpp b/include/boost/mp11/detail/mp_count.hpp index 2daed90..1e221ca 100644 --- a/include/boost/mp11/detail/mp_count.hpp +++ b/include/boost/mp11/detail/mp_count.hpp @@ -39,13 +39,13 @@ constexpr std::size_t cx_plus() template constexpr std::size_t cx_plus(T1 t1, T... t) { - return t1 + cx_plus(t...); + return static_cast(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...); + return static_cast(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>