1 #ifndef BOOST_MP11_DETAIL_MP_REMOVE_IF_HPP_INCLUDED
2 #define BOOST_MP11_DETAIL_MP_REMOVE_IF_HPP_INCLUDED
4 // Copyright 2015-2019 Peter Dimov.
6 // Distributed under the Boost Software License, Version 1.0.
8 // See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt
11 #include <boost/mp11/utility.hpp>
12 #include <boost/mp11/detail/mp_list.hpp>
13 #include <boost/mp11/detail/mp_append.hpp>
14 #include <boost/mp11/detail/config.hpp>
25 template<class L, template<class...> class P> struct mp_remove_if_impl
29 template<template<class...> class L, class... T, template<class...> class P> struct mp_remove_if_impl<L<T...>, P>
31 #if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 )
32 template<class U> struct _f { using type = mp_if<P<U>, mp_list<>, mp_list<U>>; };
33 using type = mp_append<L<>, typename _f<T>::type...>;
35 template<class U> using _f = mp_if<P<U>, mp_list<>, mp_list<U>>;
36 using type = mp_append<L<>, _f<T>...>;
42 template<class L, template<class...> class P> using mp_remove_if = typename detail::mp_remove_if_impl<L, P>::type;
43 template<class L, class Q> using mp_remove_if_q = mp_remove_if<L, Q::template fn>;
48 #endif // #ifndef BOOST_MP11_DETAIL_MP_REMOVE_IF_HPP_INCLUDED