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 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// Boost.Test
21#include <boost/test/minimal.hpp>
22
23// Boost.Bimap
24#include <boost/bimap/bimap.hpp>
25#include <boost/bimap/list_of.hpp>
26
27
28void test_bimap_info_1()
29{
30 using namespace boost::bimaps;
31
32 typedef bimap< int, list_of<int>, with_info<int> > bm_type;
33 bm_type bm;
34 bm.insert( x: bm_type::value_type(1,1) );
35
36 // fail test
37 {
38 const bm_type & cbm = bm;
39 cbm.begin()->info = 10;
40 }
41}
42
43
44int test_main( int, char* [] )
45{
46 test_bimap_info_1();
47 return 0;
48}
49
50

source code of boost/libs/bimap/test/compile_fail/test_bimap_info_1.cpp