diff --git a/include/boost/fusion/algorithm/query/detail/find_if.hpp b/include/boost/fusion/algorithm/query/detail/find_if.hpp index b200794a..06a7af79 100644 --- a/include/boost/fusion/algorithm/query/detail/find_if.hpp +++ b/include/boost/fusion/algorithm/query/detail/find_if.hpp @@ -2,6 +2,7 @@ Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2007 Dan Marsden Copyright (c) 2009 Christopher Schmidt + Copyright (c) 2018 Kohei Takahashi Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -13,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -22,10 +22,9 @@ #include #include #include +#include -namespace boost { namespace fusion { - struct random_access_traversal_tag; -namespace detail +namespace boost { namespace fusion { namespace detail { template struct apply_filter @@ -178,8 +177,8 @@ namespace detail choose_find_if< First , Last - , typename mpl::lambda::type - , is_base_of::type>::value + , Pred + , traits::is_random_access::value >::type type; @@ -208,31 +207,23 @@ namespace detail return recursive_call(iter, found()); } - template + template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - static type - choose_call(Iterator const& iter, Tag) + static typename boost::disable_if, type>::type + iter_call(Iterator const& iter) { return recursive_call(iter); } template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - static type - choose_call(Iterator const& iter, random_access_traversal_tag) + static typename boost::enable_if, type>::type + iter_call(Iterator const& iter) { typedef typename result_of::distance::type N; return fusion::advance(iter); } - template - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - static type - iter_call(Iterator const& iter) - { - return choose_call(iter, typename traits::category_of::type()); - } - template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type diff --git a/include/boost/fusion/algorithm/transformation/remove_if.hpp b/include/boost/fusion/algorithm/transformation/remove_if.hpp index 5497e3a3..3f8ebbcd 100644 --- a/include/boost/fusion/algorithm/transformation/remove_if.hpp +++ b/include/boost/fusion/algorithm/transformation/remove_if.hpp @@ -1,7 +1,8 @@ /*============================================================================= Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2018 Kohei Takahashi - Distributed under the Boost Software License, Version 1.0. (See accompanying + Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #if !defined(FUSION_REMOVE_IF_07162005_0818) @@ -10,7 +11,6 @@ #include #include #include -#include namespace boost { namespace fusion { diff --git a/include/boost/fusion/view/filter_view/detail/next_impl.hpp b/include/boost/fusion/view/filter_view/detail/next_impl.hpp index 4f174557..bd1404b9 100644 --- a/include/boost/fusion/view/filter_view/detail/next_impl.hpp +++ b/include/boost/fusion/view/filter_view/detail/next_impl.hpp @@ -1,5 +1,6 @@ /*============================================================================= Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2018 Kohei Takahashi Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -8,14 +9,10 @@ #define FUSION_NEXT_IMPL_06052005_0900 #include -#include -#include +#include +#include #include #include -#include -#include -#include -#include namespace boost { namespace fusion { @@ -48,26 +45,13 @@ namespace boost { namespace fusion >::type next_type; - typedef typename - detail::static_find_if< - next_type - , last_type - , mpl::bind1< - typename mpl::lambda::type - , mpl::bind1,mpl::_1> - > - > - filter; - - typedef filter_iterator< - category, typename filter::type, last_type, pred_type> - type; + typedef filter_iterator type; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { - return type(filter::iter_call(i.first)); + return type(fusion::next(i.first)); } }; }; diff --git a/include/boost/fusion/view/filter_view/filter_view_iterator.hpp b/include/boost/fusion/view/filter_view/filter_view_iterator.hpp index f1b9f54d..8d77e12e 100644 --- a/include/boost/fusion/view/filter_view/filter_view_iterator.hpp +++ b/include/boost/fusion/view/filter_view/filter_view_iterator.hpp @@ -1,5 +1,6 @@ /*============================================================================= Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2018 Kohei Takahashi Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,7 +10,6 @@ #include #include -#include #include #include #include