diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index a55307f..cb03a9e 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -91,3 +91,4 @@ run mp_or.cpp : : : $(REQ) ; # map run mp_map_find.cpp : : : $(REQ) ; +run mp_map_contains.cpp : : : $(REQ) ; diff --git a/test/mp_map_contains.cpp b/test/mp_map_contains.cpp new file mode 100644 index 0000000..e9d36b2 --- /dev/null +++ b/test/mp_map_contains.cpp @@ -0,0 +1,51 @@ + +// Copyright 2016 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 +#include +#include +#include +#include + +int main() +{ + using boost::mp_map_contains; + using boost::mp_list; + using boost::mp_true; + using boost::mp_false; + + BOOST_TEST_TRAIT_TRUE((std::is_same, char>, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, int>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, char>, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, int>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, long>, mp_true>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, char>, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, int>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, long>, mp_true>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, char>, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, int>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, long>, mp_true>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_list, mp_list>, char>, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_list, mp_list>, int>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_list, mp_list>, long>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_list, mp_list>, long long>, mp_true>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair, std::tuple>, char>, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair, std::tuple>, int>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair, std::tuple>, long>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair, std::tuple>, long long>, mp_true>)); + + return boost::report_errors(); +}