]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2001-2011 Joel de Guzman | |
92f5a8d4 | 3 | Copyright (c) 2018 Kohei Takahashi |
7c673cae | 4 | |
92f5a8d4 | 5 | Distributed under the Boost Software License, Version 1.0. (See accompanying |
7c673cae FG |
6 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
7 | ==============================================================================*/ | |
8 | #if !defined(FUSION_REMOVE_IF_07162005_0818) | |
9 | #define FUSION_REMOVE_IF_07162005_0818 | |
10 | ||
11 | #include <boost/fusion/support/config.hpp> | |
12 | #include <boost/fusion/view/filter_view/filter_view.hpp> | |
13 | #include <boost/mpl/not.hpp> | |
7c673cae FG |
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 | |
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 |