Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/optional/test/optional_test_fail3b.cpp @ 45

Last change on this file since 45 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 663 bytes
Line 
1// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
2//
3// Use, modification, and distribution is subject to the Boost Software
4// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5// http://www.boost.org/LICENSE_1_0.txt)
6//
7// See http://www.boost.org/lib/optional for documentation.
8//
9// You are welcome to contact the author at:
10//  fernando_cacciola@hotmail.com
11//
12#include<string>
13
14#include "boost/optional.hpp"
15
16struct A {} ;
17struct B {} ;
18//
19// THIS TEST SHOULD FAIL TO COMPILE
20//
21void test_no_unsupported_conversion()
22{
23  boost::optional<A> opt1;
24  boost::optional<B> opt2;
25  opt2 = opt1 ; // Cannot convert from "A" to "B"
26}
27
28
Note: See TracBrowser for help on using the repository browser.