]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/bimap/test/test_bimap_property_map.cpp
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>
28 #include <boost/test/minimal.hpp>
32 #include <boost/bimap/set_of.hpp>
33 #include <boost/bimap/property_map/set_support.hpp>
35 #include <boost/bimap/unordered_set_of.hpp>
36 #include <boost/bimap/property_map/unordered_set_support.hpp>
38 #include <boost/bimap/bimap.hpp>
42 void test_readable_property_map(
44 typename
boost::property_traits
<Map
>:: key_type
const & key
,
45 typename
boost::property_traits
<Map
>::value_type
const & value
48 // TODO Add STATIC_ASSERT(
49 // boost::property_traits<Map>::category is readable )
51 BOOST_CHECK( get(m
,key
) == value
);
52 //BOOST_CHECK( m[key] == value );
56 void test_bimap_property_map()
58 using namespace boost::bimaps
;
60 typedef bimap
< set_of
<int>, unordered_set_of
<double> > bm
;
63 b
.insert( bm::value_type(1,0.1) );
64 b
.insert( bm::value_type(2,0.2) );
65 b
.insert( bm::value_type(3,0.3) );
67 test_readable_property_map(b
.left
, 1,0.1);
68 test_readable_property_map(b
.right
,0.1, 1);
71 int test_main( int, char* [] )
73 test_bimap_property_map();