forked from boostorg/mp11
Add test/mp_set_difference_sf.cpp
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
#include <boost/mp11/detail/mp_list.hpp>
|
#include <boost/mp11/detail/mp_list.hpp>
|
||||||
#include <boost/mp11/detail/mp_append.hpp>
|
#include <boost/mp11/detail/mp_append.hpp>
|
||||||
#include <boost/mp11/detail/mp_remove_if.hpp>
|
#include <boost/mp11/detail/mp_remove_if.hpp>
|
||||||
|
#include <boost/mp11/detail/mp_is_list.hpp>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
@@ -144,7 +145,7 @@ template<class... S> struct in_any_set
|
|||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
template<class L, class... S> using mp_set_difference = mp_remove_if_q<L, detail::in_any_set<S...>>;
|
template<class L, class... S> using mp_set_difference = mp_if< mp_all<mp_is_list<S>...>, mp_remove_if_q<L, detail::in_any_set<S...>> >;
|
||||||
|
|
||||||
} // namespace mp11
|
} // namespace mp11
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
@@ -136,6 +136,7 @@ run mp_is_set.cpp ;
|
|||||||
run mp_set_union.cpp ;
|
run mp_set_union.cpp ;
|
||||||
run mp_set_union_sf.cpp ;
|
run mp_set_union_sf.cpp ;
|
||||||
run mp_set_difference.cpp ;
|
run mp_set_difference.cpp ;
|
||||||
|
run mp_set_difference_sf.cpp ;
|
||||||
|
|
||||||
# function
|
# function
|
||||||
run mp_all.cpp ;
|
run mp_all.cpp ;
|
||||||
|
33
test/mp_set_difference_sf.cpp
Normal file
33
test/mp_set_difference_sf.cpp
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
// Copyright 2019 Peter Dimov.
|
||||||
|
//
|
||||||
|
// 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
|
||||||
|
|
||||||
|
|
||||||
|
#include <boost/mp11/set.hpp>
|
||||||
|
#include <boost/mp11/utility.hpp>
|
||||||
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
using boost::mp11::mp_set_difference;
|
||||||
|
using boost::mp11::mp_valid;
|
||||||
|
using boost::mp11::mp_list;
|
||||||
|
|
||||||
|
BOOST_TEST_TRAIT_FALSE((mp_valid<mp_set_difference>));
|
||||||
|
BOOST_TEST_TRAIT_FALSE((mp_valid<mp_set_difference, void>));
|
||||||
|
BOOST_TEST_TRAIT_FALSE((mp_valid<mp_set_difference, void, void>));
|
||||||
|
BOOST_TEST_TRAIT_FALSE((mp_valid<mp_set_difference, void, void, void>));
|
||||||
|
BOOST_TEST_TRAIT_FALSE((mp_valid<mp_set_difference, void, void, void, void>));
|
||||||
|
BOOST_TEST_TRAIT_FALSE((mp_valid<mp_set_difference, void, void, void, void, void>));
|
||||||
|
|
||||||
|
BOOST_TEST_TRAIT_FALSE((mp_valid<mp_set_difference, mp_list<>, void>));
|
||||||
|
BOOST_TEST_TRAIT_FALSE((mp_valid<mp_set_difference, mp_list<>, mp_list<>, void>));
|
||||||
|
BOOST_TEST_TRAIT_FALSE((mp_valid<mp_set_difference, mp_list<>, mp_list<>, mp_list<>, void>));
|
||||||
|
BOOST_TEST_TRAIT_FALSE((mp_valid<mp_set_difference, mp_list<>, mp_list<>, mp_list<>, mp_list<>, void>));
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
Reference in New Issue
Block a user