From 6fdfb5bde8552b1779224480818e2667e88836b2 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 24 Mar 2021 18:59:09 +0200 Subject: [PATCH] Avoid g++-10 warning about < 0 compare --- include/boost/mp11/detail/mp_count.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/mp11/detail/mp_count.hpp b/include/boost/mp11/detail/mp_count.hpp index bc8aed9..37b39ed 100644 --- a/include/boost/mp11/detail/mp_count.hpp +++ b/include/boost/mp11/detail/mp_count.hpp @@ -51,9 +51,9 @@ template constexpr std::size_t cx_count() std::size_t r = 0; - for( std::size_t i = 0; i < sizeof...(T); ++i ) + for( std::size_t i = 1; i < sizeof...(T) + 1; ++i ) { - r += a[ i+1 ]; + r += a[ i ]; } return r; @@ -98,9 +98,9 @@ template class P, class... T> constexpr std::size_t cx_count_ std::size_t r = 0; - for( std::size_t i = 0; i < sizeof...(T); ++i ) + for( std::size_t i = 1; i < sizeof...(T) + 1; ++i ) { - r += a[ i+1 ]; + r += a[ i ]; } return r;