3 // Copyright (c) 2006-2007 Matias Capeletto
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // VC++ 8.0 warns on usage of certain Standard Library and API functions that
10 // can be cause buffer overruns or other possible security issues if misused.
11 // See http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx
12 // But the wording of the warning is misleading and unsettling, there are no
13 // portable alternative functions, and VC++ 8.0's own libraries use the
14 // functions in question. So turn off the warnings.
15 #define _CRT_SECURE_NO_DEPRECATE
16 #define _SCL_SECURE_NO_DEPRECATE
18 #include <boost/config.hpp>
21 #include <boost/test/minimal.hpp>
23 #include <boost/static_assert.hpp>
24 #include <boost/type_traits/is_same.hpp>
27 #include <boost/bimap/support/lambda.hpp>
28 #include <boost/bimap/bimap.hpp>
29 #include <boost/bimap/list_of.hpp>
31 // Support metafunctions
32 #include <boost/bimap/support/data_type_by.hpp>
33 #include <boost/bimap/support/key_type_by.hpp>
34 #include <boost/bimap/support/map_type_by.hpp>
35 #include <boost/bimap/support/value_type_by.hpp>
36 #include <boost/bimap/support/iterator_type_by.hpp>
37 #include <boost/bimap/relation/support/pair_type_by.hpp>
39 using namespace boost::bimaps
;
40 using namespace boost::bimaps::support
;
41 using namespace boost::bimaps::relation::support
;
43 typedef bimap
<int, unconstrained_set_of
<double> > bm_type
;
45 namespace support_metafunctions_test
{
47 typedef boost::is_same
49 data_type_by
< member_at::left
, bm_type
>::type
,
50 key_type_by
< member_at::right
, bm_type
>::type
52 >::type test_metafunction_1
;
53 BOOST_STATIC_ASSERT(test_metafunction_1::value
);
55 typedef boost::is_same
57 data_type_by
< member_at::right
, bm_type
>::type
,
58 key_type_by
< member_at::left
, bm_type
>::type
60 >::type test_metafunction_2
;
61 BOOST_STATIC_ASSERT(test_metafunction_2::value
);
63 typedef boost::is_same
65 map_type_by
< member_at::left
, bm_type
>::type::value_type
,
66 value_type_by
< member_at::left
, bm_type
>::type
68 >::type test_metafunction_3
;
69 BOOST_STATIC_ASSERT(test_metafunction_3::value
);
71 typedef boost::is_same
73 pair_type_by
< member_at::left
, bm_type::relation
>::type
,
74 value_type_by
< member_at::left
, bm_type
>::type
76 >::type test_metafunction_4
;
77 BOOST_STATIC_ASSERT(test_metafunction_4::value
);
79 } // namespace support_metafunctions_test
81 void test_bimap_extra()
84 // ---------------------------------------------------------------
85 // This section test small things... when a group of this checks
86 // can be related it is moved to a separate unit test file.
93 int test_main( int, char* [] )