diff --git a/test/Jamfile b/test/Jamfile index aa4ba94..ee42fd8 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -187,6 +187,7 @@ run mp_similar.cpp ; # map run mp_map_find.cpp ; run mp_map_find_2.cpp ; +run mp_map_find_3.cpp ; run mp_map_contains.cpp ; run mp_map_insert.cpp ; run mp_map_replace.cpp ; diff --git a/test/mp_map_find_2.cpp b/test/mp_map_find_2.cpp index b36a9a5..a46af5d 100644 --- a/test/mp_map_find_2.cpp +++ b/test/mp_map_find_2.cpp @@ -11,23 +11,23 @@ #include #include -struct Foo {}; -struct Bar {}; +struct X {}; +struct Y {}; int main() { using boost::mp11::mp_map_find; - using L1 = std::tuple, std::tuple, std::tuple, std::tuple>; + using L1 = std::tuple, std::tuple, std::tuple, std::tuple>; BOOST_TEST_TRAIT_SAME( mp_map_find, std::tuple ); - BOOST_TEST_TRAIT_SAME( mp_map_find, std::tuple ); - BOOST_TEST_TRAIT_SAME( mp_map_find, std::tuple ); + BOOST_TEST_TRAIT_SAME( mp_map_find, std::tuple ); + BOOST_TEST_TRAIT_SAME( mp_map_find, std::tuple ); - using L2 = std::tuple, std::tuple>; + using L2 = std::tuple, std::tuple>; - BOOST_TEST_TRAIT_SAME( mp_map_find, std::tuple ); - BOOST_TEST_TRAIT_SAME( mp_map_find, std::tuple ); + BOOST_TEST_TRAIT_SAME( mp_map_find, std::tuple ); + BOOST_TEST_TRAIT_SAME( mp_map_find, std::tuple ); return boost::report_errors(); } diff --git a/test/mp_map_find_3.cpp b/test/mp_map_find_3.cpp new file mode 100644 index 0000000..cf25c73 --- /dev/null +++ b/test/mp_map_find_3.cpp @@ -0,0 +1,34 @@ + +// Copyright 2016, 2020 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 + +// Same as mp_map_find_2.cpp, but with includes reversed + +#include +#include +#include + +struct X {}; +struct Y {}; + +int main() +{ + using boost::mp11::mp_map_find; + + using L1 = std::tuple, std::tuple, std::tuple, std::tuple>; + + BOOST_TEST_TRAIT_SAME( mp_map_find, std::tuple ); + BOOST_TEST_TRAIT_SAME( mp_map_find, std::tuple ); + BOOST_TEST_TRAIT_SAME( mp_map_find, std::tuple ); + + using L2 = std::tuple, std::tuple>; + + BOOST_TEST_TRAIT_SAME( mp_map_find, std::tuple ); + BOOST_TEST_TRAIT_SAME( mp_map_find, std::tuple ); + + return boost::report_errors(); +}