diff --git a/include/boost/mp11/map.hpp b/include/boost/mp11/map.hpp index 8c5afc3..a9236ce 100644 --- a/include/boost/mp11/map.hpp +++ b/include/boost/mp11/map.hpp @@ -1,21 +1,27 @@ #ifndef BOOST_MP11_MAP_HPP_INCLUDED #define BOOST_MP11_MAP_HPP_INCLUDED -// Copyright 2015 Peter Dimov. +// Copyright 2015, 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 + namespace boost { -// mp_map_find // mp_map_contains +template using mp_map_contains = mp_not, void>>; + // mp_map_insert // mp_map_replace // mp_map_update +// mp_map_erase } // namespace boost diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index dd1c838..a55307f 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -88,3 +88,6 @@ run mp_all.cpp : : : $(REQ) ; run mp_and.cpp : : : $(REQ) ; run mp_any.cpp : : : $(REQ) ; run mp_or.cpp : : : $(REQ) ; + +# map +run mp_map_find.cpp : : : $(REQ) ; diff --git a/test/mp_map_find.cpp b/test/mp_map_find.cpp new file mode 100644 index 0000000..6c26b9b --- /dev/null +++ b/test/mp_map_find.cpp @@ -0,0 +1,48 @@ + +// 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 + +int main() +{ + using boost::mp_map_find; + using boost::mp_list; + + BOOST_TEST_TRAIT_TRUE((std::is_same, char>, void>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, int>, void>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, char>, void>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, int>, std::pair>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, long>, std::pair>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, char>, void>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, int>, std::pair>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, long>, std::pair>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, char>, void>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, int>, std::pair>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>, long>, std::pair>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_list, mp_list>, char>, void>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_list, mp_list>, int>, mp_list>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_list, mp_list>, long>, mp_list>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_list, mp_list>, long long>, mp_list>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair, std::tuple>, char>, void>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair, std::tuple>, int>, mp_list>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair, std::tuple>, long>, std::pair>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair, std::tuple>, long long>, std::tuple>)); + + return boost::report_errors(); +}