Skip to content

Commit f8ee448

Browse files
committed
Add test case from #106. Refs #106.
1 parent 7e04eb3 commit f8ee448

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

test/Jamfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ run mp_similar.cpp ;
250250
run mp_map_find.cpp ;
251251
run mp_map_find_2.cpp ;
252252
run mp_map_find_3.cpp ;
253+
run mp_map_find_4.cpp ;
253254
run mp_map_contains.cpp ;
254255
run mp_map_insert.cpp ;
255256
run mp_map_replace.cpp ;

test/mp_map_find_4.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright 2016, 2020, 2024 Peter Dimov
2+
// Distributed under the Boost Software License, Version 1.0.
3+
// https://www.boost.org/LICENSE_1_0.txt
4+
5+
#include <boost/mp11/map.hpp>
6+
#include <boost/mp11/list.hpp>
7+
#include <boost/core/lightweight_test_trait.hpp>
8+
9+
template<class T> struct Wrap
10+
{
11+
struct type {};
12+
};
13+
14+
int main()
15+
{
16+
using boost::mp11::mp_map_find;
17+
using boost::mp11::mp_list;
18+
19+
using Int = Wrap<int>::type;
20+
using Long = Wrap<long>::type;
21+
22+
using Map = mp_list<
23+
mp_list<Int, void>,
24+
mp_list<Long, void>
25+
>;
26+
27+
BOOST_TEST_TRAIT_SAME( mp_map_find<Map, Int>, mp_list<Int, void> );
28+
BOOST_TEST_TRAIT_SAME( mp_map_find<Map, Long>, mp_list<Long, void> );
29+
BOOST_TEST_TRAIT_SAME( mp_map_find<Map, int>, void );
30+
31+
return boost::report_errors();
32+
}

0 commit comments

Comments
 (0)