Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/optional/test/optional_test_fail1.cpp @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 620 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 "boost/optional.hpp"
13
14//
15// THIS TEST SHOULD FAIL TO COMPILE
16//
17void test_deep_constantness()
18{
19  boost::optional<int> opt ;
20  boost::optional<int> const copt ;
21
22  *copt = opt ; // Cannot assign to "int const&"
23}
24
25
Note: See TracBrowser for help on using the repository browser.