Skip to content

Commit 82533c4

Browse files
committed
Do not use fold expressions for mp_find and mp_find_if
1 parent 35435bf commit 82533c4

File tree

1 file changed

+2
-40
lines changed

1 file changed

+2
-40
lines changed

include/boost/mp11/algorithm.hpp

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -719,37 +719,7 @@ namespace detail
719719

720720
template<class L, class V> struct mp_find_impl;
721721

722-
#if BOOST_MP11_CLANG && defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS )
723-
724-
struct mp_index_holder
725-
{
726-
std::size_t i_;
727-
bool f_;
728-
};
729-
730-
constexpr inline mp_index_holder operator+( mp_index_holder const & v, bool f )
731-
{
732-
if( v.f_ )
733-
{
734-
return v;
735-
}
736-
else if( f )
737-
{
738-
return { v.i_, true };
739-
}
740-
else
741-
{
742-
return { v.i_ + 1, false };
743-
}
744-
}
745-
746-
template<template<class...> class L, class... T, class V> struct mp_find_impl<L<T...>, V>
747-
{
748-
static constexpr mp_index_holder _v{ 0, false };
749-
using type = mp_size_t< (_v + ... + std::is_same<T, V>::value).i_ >;
750-
};
751-
752-
#elif !defined( BOOST_MP11_NO_CONSTEXPR )
722+
#if !defined( BOOST_MP11_NO_CONSTEXPR )
753723

754724
template<template<class...> class L, class V> struct mp_find_impl<L<>, V>
755725
{
@@ -828,15 +798,7 @@ namespace detail
828798

829799
template<class L, template<class...> class P> struct mp_find_if_impl;
830800

831-
#if BOOST_MP11_CLANG && defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS )
832-
833-
template<template<class...> class L, class... T, template<class...> class P> struct mp_find_if_impl<L<T...>, P>
834-
{
835-
static constexpr mp_index_holder _v{ 0, false };
836-
using type = mp_size_t< (_v + ... + P<T>::value).i_ >;
837-
};
838-
839-
#elif !defined( BOOST_MP11_NO_CONSTEXPR )
801+
#if !defined( BOOST_MP11_NO_CONSTEXPR )
840802

841803
template<template<class...> class L, template<class...> class P> struct mp_find_if_impl<L<>, P>
842804
{

0 commit comments

Comments
 (0)