]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/bimap/test/test_bimap_lambda.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / bimap / test / test_bimap_lambda.cpp
CommitLineData
7c673cae
FG
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.
92f5a8d4 11// See https://web.archive.org/web/20071014014301/http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx
7c673cae
FG
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
20effc67 20#include <boost/core/lightweight_test.hpp>
7c673cae
FG
21
22// Boost.Bimap
23#include <boost/bimap/support/lambda.hpp>
24#include <boost/bimap/bimap.hpp>
25
26void test_bimap_lambda()
27{
28 using namespace boost::bimaps;
29
30 typedef bimap<int,double> bm;
31
32 bm b;
33 b.insert( bm::value_type(1,0.1) );
34
20effc67
TL
35 BOOST_TEST( b.size() == 1 );
36 BOOST_TEST( b.left.modify_key ( b.left.begin(), _key = 2 ) );
37 BOOST_TEST( b.left.modify_data( b.left.begin(), _data = 0.2 ) );
38 BOOST_TEST( b.left.range( _key >= 1, _key < 3 ).first == b.left.begin() );
7c673cae
FG
39}
40
20effc67 41int main()
7c673cae
FG
42{
43 test_bimap_lambda();
20effc67 44 return boost::report_errors();
7c673cae
FG
45}
46