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_FILTER_IF_07172005_0818)
8 #define FUSION_FILTER_IF_07172005_0818
9 
10 #include <boost/fusion/support/config.hpp>
11 #include <boost/fusion/view/filter_view/filter_view.hpp>
12 
13 namespace boost { namespace fusion
14 {
15     namespace result_of
16     {
17         template <typename Sequence, typename Pred>
18         struct filter_if
19         {
20             typedef filter_view<Sequence, Pred> type;
21         };
22     }
23 
24     template <typename Pred, typename Sequence>
25     BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
26     inline typename result_of::filter_if<Sequence const, Pred>::type
filter_if(Sequence const & seq)27     filter_if(Sequence const& seq)
28     {
29         return filter_view<Sequence const, Pred>(seq);
30     }
31 }}
32 
33 #endif
34 
35