diff --git a/include/boost/mp11/set.hpp b/include/boost/mp11/set.hpp index b3917db..54f5f42 100644 --- a/include/boost/mp11/set.hpp +++ b/include/boost/mp11/set.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include namespace boost @@ -144,7 +145,7 @@ template struct in_any_set } // namespace detail -template using mp_set_difference = mp_remove_if_q>; +template using mp_set_difference = mp_if< mp_all...>, mp_remove_if_q> >; } // namespace mp11 } // namespace boost diff --git a/test/Jamfile b/test/Jamfile index ba34e7a..ba715e3 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -136,6 +136,7 @@ run mp_is_set.cpp ; run mp_set_union.cpp ; run mp_set_union_sf.cpp ; run mp_set_difference.cpp ; +run mp_set_difference_sf.cpp ; # function run mp_all.cpp ; diff --git a/test/mp_set_difference_sf.cpp b/test/mp_set_difference_sf.cpp new file mode 100644 index 0000000..ddcb63d --- /dev/null +++ b/test/mp_set_difference_sf.cpp @@ -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 +#include +#include + +int main() +{ + using boost::mp11::mp_set_difference; + using boost::mp11::mp_valid; + using boost::mp11::mp_list; + + BOOST_TEST_TRAIT_FALSE((mp_valid)); + BOOST_TEST_TRAIT_FALSE((mp_valid)); + BOOST_TEST_TRAIT_FALSE((mp_valid)); + BOOST_TEST_TRAIT_FALSE((mp_valid)); + BOOST_TEST_TRAIT_FALSE((mp_valid)); + BOOST_TEST_TRAIT_FALSE((mp_valid)); + + BOOST_TEST_TRAIT_FALSE((mp_valid, void>)); + BOOST_TEST_TRAIT_FALSE((mp_valid, mp_list<>, void>)); + BOOST_TEST_TRAIT_FALSE((mp_valid, mp_list<>, mp_list<>, void>)); + BOOST_TEST_TRAIT_FALSE((mp_valid, mp_list<>, mp_list<>, mp_list<>, void>)); + + return boost::report_errors(); +}