From 9215c68d35a1483ddb435a10e47a301e28c1415b Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 23 Mar 2021 03:11:03 +0200 Subject: [PATCH] Implement mp_any in terms of mp_count --- include/boost/mp11/function.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/mp11/function.hpp b/include/boost/mp11/function.hpp index 162bf29..e20b452 100644 --- a/include/boost/mp11/function.hpp +++ b/include/boost/mp11/function.hpp @@ -123,13 +123,13 @@ template struct mp_or_impl // mp_any // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86356 -#if defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS ) && !BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, != 0 ) && !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 ) +#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 ) || BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, != 0 ) -template using mp_any = mp_bool<(static_cast(T::value) || ...)>; +template using mp_any = mp_bool< mp_count_if< mp_list, mp_to_bool >::value != 0 >; #else -template using mp_any = mp_bool< mp_count_if< mp_list, mp_to_bool >::value != 0 >; +template using mp_any = mp_bool< mp_count< mp_list...>, mp_true >::value != 0 >; #endif