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>
24 #include <boost/bimap/support/lambda.hpp>
25 #include <boost/bimap/bimap.hpp>
28 void test_bimap_unconstrained()
30 using namespace boost::bimaps
;
33 typedef bimap
<int,double,unconstrained_set_of_relation
> bm
;
35 b
.left
.insert( bm::left_value_type(2,34.4) );
36 b
.right
.insert( bm::right_value_type(2.2,3) );
40 typedef bimap
<int,unconstrained_set_of
<double> > bm
;
42 b
.insert( bm::value_type(2,34.4) );
43 BOOST_CHECK( b
.size() == 1 );
47 typedef bimap
<unconstrained_set_of
<int>, double > bm
;
50 BOOST_CHECK( b
.right
.size() == 1 );
54 typedef bimap
<unconstrained_set_of
<int>, double, right_based
> bm
;
57 BOOST_CHECK( b
.right
.size() == 1 );
64 unconstrained_set_of
<double>,
65 unconstrained_set_of_relation
71 BOOST_CHECK( b
.left
.size() == 1 );
77 unconstrained_set_of
<int>,
79 unconstrained_set_of_relation
85 BOOST_CHECK( b
.right
.size() == 1 );
91 unconstrained_set_of
<int>,
92 unconstrained_set_of
<double>,
98 b
.insert( bm::value_type(1,2.3) );
99 BOOST_CHECK( b
.size() == 1 );
104 int test_main( int, char* [] )
106 test_bimap_unconstrained();