From 614dec90a7b1abe17d39d613bbaca4a6198aa240 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 7 Jan 2019 22:45:51 +0200 Subject: [PATCH] Add test/mp_set_intersection_sf.cpp --- include/boost/mp11/set.hpp | 2 +- test/Jamfile | 1 + test/mp_set_intersection_sf.cpp | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 test/mp_set_intersection_sf.cpp diff --git a/include/boost/mp11/set.hpp b/include/boost/mp11/set.hpp index 45ba982..d8d17b5 100644 --- a/include/boost/mp11/set.hpp +++ b/include/boost/mp11/set.hpp @@ -144,7 +144,7 @@ template struct in_all_sets template using fn = mp_all< mp_set_contains... >; }; -template using mp_set_intersection_ = mp_copy_if_q>; +template using mp_set_intersection_ = mp_if< mp_all, mp_is_list...>, mp_copy_if_q> >; template struct mp_set_intersection_impl { diff --git a/test/Jamfile b/test/Jamfile index 16509e6..b2460ba 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -138,6 +138,7 @@ run mp_set_union_sf.cpp ; run mp_set_difference.cpp ; run mp_set_difference_sf.cpp ; run mp_set_intersection.cpp ; +run mp_set_intersection_sf.cpp ; # function run mp_all.cpp ; diff --git a/test/mp_set_intersection_sf.cpp b/test/mp_set_intersection_sf.cpp new file mode 100644 index 0000000..21af2ef --- /dev/null +++ b/test/mp_set_intersection_sf.cpp @@ -0,0 +1,32 @@ + +// 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_intersection; + 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, 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(); +}