]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/bimap/test/test_bimap_extra.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / bimap / test / test_bimap_extra.cpp
1 // Boost.Bimap
2 //
3 // Copyright (c) 2006-2007 Matias Capeletto
4 //
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)
8
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 https://web.archive.org/web/20071014014301/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
17
18 #include <boost/config.hpp>
19
20 #include <boost/static_assert.hpp>
21 #include <boost/type_traits/is_same.hpp>
22
23 // Boost.Bimap
24 #include <boost/bimap/support/lambda.hpp>
25 #include <boost/bimap/bimap.hpp>
26 #include <boost/bimap/list_of.hpp>
27
28 // Support metafunctions
29 #include <boost/bimap/support/data_type_by.hpp>
30 #include <boost/bimap/support/key_type_by.hpp>
31 #include <boost/bimap/support/map_type_by.hpp>
32 #include <boost/bimap/support/value_type_by.hpp>
33 #include <boost/bimap/support/iterator_type_by.hpp>
34 #include <boost/bimap/relation/support/pair_type_by.hpp>
35
36 using namespace boost::bimaps;
37 using namespace boost::bimaps::support;
38 using namespace boost::bimaps::relation::support ;
39
40 typedef bimap<int, unconstrained_set_of<double> > bm_type;
41
42 namespace support_metafunctions_test {
43
44 typedef boost::is_same
45 <
46 data_type_by< member_at::left , bm_type >::type,
47 key_type_by < member_at::right, bm_type >::type
48
49 >::type test_metafunction_1;
50 BOOST_STATIC_ASSERT(test_metafunction_1::value);
51
52 typedef boost::is_same
53 <
54 data_type_by< member_at::right, bm_type >::type,
55 key_type_by < member_at::left , bm_type >::type
56
57 >::type test_metafunction_2;
58 BOOST_STATIC_ASSERT(test_metafunction_2::value);
59
60 typedef boost::is_same
61 <
62 map_type_by < member_at::left , bm_type >::type::value_type,
63 value_type_by< member_at::left , bm_type >::type
64
65 >::type test_metafunction_3;
66 BOOST_STATIC_ASSERT(test_metafunction_3::value);
67
68 typedef boost::is_same
69 <
70 pair_type_by< member_at::left, bm_type::relation>::type,
71 value_type_by< member_at::left , bm_type >::type
72
73 >::type test_metafunction_4;
74 BOOST_STATIC_ASSERT(test_metafunction_4::value);
75
76 } // namespace support_metafunctions_test
77
78 void test_bimap_extra()
79 {
80 // extra tests
81 // ---------------------------------------------------------------
82 // This section test small things... when a group of this checks
83 // can be related it is moved to a separate unit test file.
84
85
86
87 }
88
89
90 int main()
91 {
92 test_bimap_extra();
93 return 0;
94 }
95