1 /*============================================================================= 2 Copyright (c) 2001-2011 Joel de Guzman 3 4 Distributed under the Boost Software License, Version 1.0. (See accompanying 5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 ==============================================================================*/ 7 #if !defined(FUSION_REMOVE_IF_07162005_0818) 8 #define FUSION_REMOVE_IF_07162005_0818 9 10 #include <boost/fusion/support/config.hpp> 11 #include <boost/fusion/view/filter_view/filter_view.hpp> 12 #include <boost/mpl/not.hpp> 13 #include <boost/type_traits/is_same.hpp> 14 15 namespace boost { namespace fusion 16 { 17 namespace result_of 18 { 19 template <typename Sequence, typename Pred> 20 struct remove_if 21 { 22 typedef filter_view<Sequence, mpl::not_<Pred> > type; 23 }; 24 } 25 26 template <typename Pred, typename Sequence> 27 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED 28 inline typename result_of::remove_if<Sequence const, Pred>::type remove_if(Sequence const & seq)29 remove_if(Sequence const& seq) 30 { 31 typedef typename result_of::remove_if<Sequence const, Pred>::type result_type; 32 return result_type(seq); 33 } 34 }} 35 36 #endif 37 38